Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Perf tests dev, continued

  • Loading branch information...
commit eceb559b660d397223091fd5984f96004319f503 1 parent 1120389
Roman Rudenko authored
Showing with 1,228 additions and 59 deletions.
  1. +8 −8 test/integration/analyzeDeltas.js
  2. +34 −15 test/integration/mobifyjs.coffee
  3. +1 −0  test/integration/performance/02.basicResource/bld/mobify.js
  4. +15 −2 test/integration/performance/02.basicResource/src/mobify.konf
  5. +12 −0 test/integration/performance/03.beyondtherack-home.html
  6. +1 −0  test/integration/performance/03.beyondtherack-home/bld/mobify.js
  7. +9 −0 test/integration/performance/03.beyondtherack-home/project.json
  8. +23 −0 test/integration/performance/03.beyondtherack-home/src/mobify.konf
  9. +10 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/404.tmpl
  10. +5 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/_categorynav.tmpl
  11. +68 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/_footer.tmpl
  12. +86 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/_header.tmpl
  13. +23 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/_record_sale_js.tmpl
  14. +24 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/accountinfo.tmpl
  15. +42 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/base.tmpl
  16. +14 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/base_smartphone.tmpl
  17. +47 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/base_tablet.tmpl
  18. +90 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/cart.tmpl
  19. +15 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/contact.tmpl
  20. +9 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/default.tmpl
  21. +95 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/events.tmpl
  22. +15 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/faq.tmpl
  23. +5 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/forgotPassword.tmpl
  24. +16 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/inviteafriend.tmpl
  25. +38 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/landing.tmpl
  26. +8 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/orderConfirmation.tmpl
  27. +272 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/pdp.tmpl
  28. +145 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/productlist.tmpl
  29. +9 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/recommend.tmpl
  30. +29 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/register.tmpl
  31. +9 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/sizechart.tmpl
  32. +47 −0 test/integration/performance/03.beyondtherack-home/src/tmpl/trackorders.tmpl
  33. +4 −34 test/integration/run-tests.js
View
16 test/integration/analyzeDeltas.js
@@ -24,20 +24,20 @@
'infinity': 1.96
};
- window.analyzeDeltas = function(timingPoints) {
+ module.exports = function(timingPoints) {
var deltas = [];
timingPoints.forEach(function(run) {
run.forEach(function(entry, i) {
- var lastEntry = i ? run[i-1] : entry;
- var delta = entry[0] - lastEntry[0];
+ var lastEntry = run[(run.length + i-1) % run.length];
+ var delta = Math.abs(entry[0] - lastEntry[0]);
deltas[i] = deltas[i] || [];
- deltas[i].name = entry[1];
+ deltas[i].name = i ? entry[1] : 'Total';
deltas[i].push(delta / 1e3);
})
});
- deltas.forEach(function(delta) {
+ return deltas.map(function(delta) {
delta.mean = getMean(delta);
// sample variance (estimate of the population variance)
delta.variance = delta.reduce(
@@ -57,8 +57,8 @@
// relative margin of error
delta.rme = (delta.moe / delta.mean) * 100 || 0;
- log(' ' + delta.name + ', avg ' + (delta.mean * 1e3).toFixed(2) + 'ms \xb1'
- + delta.rme.toFixed(2) + '%');
- });
+ return ' ' + delta.name + ', avg ' + (delta.mean * 1e3).toFixed(2) + 'ms +/-'
+ + delta.rme.toFixed(2) + '%';
+ }).join('\n');
};
})();
View
49 test/integration/mobifyjs.coffee
@@ -17,8 +17,10 @@ Injector = require '../../src/injector.coffee'
{Project} = require '../../src/project.coffee'
Preview = require '../../src/preview.coffee'
Scaffold = require '../../src/scaffold.coffee'
+analyzeDeltas = require './analyzeDeltas.js'
PORT = { STATIC: 1341, TAG: 1342, PREVIEW: 8080 }
+PERF_ITERATIONS = 50
requestLog = [];
logRequests = () ->
result = requestLog.join('\n')
@@ -39,15 +41,35 @@ program
start = (mode) ->
integrationDir = "#{__dirname}/../integration"
- tests = fs.readdirSync(integrationDir + '/' + mode).filter((x) -> x.match(/^\d+\.[^.]+$/))
+ tests = fs.readdirSync(integrationDir + '/' + mode)
+ .filter((x) -> x.match(/^\d+\.[^.]+$/))
# Static Server
@static = new Connect()
.use(Connect.query())
+ .use(Connect.cookieParser())
+ .use(Connect.session({ secret: "keyboard cat" }))
.use('/', (req, res, next) ->
- return next() if req.query.tests or req.url != '/'
- res.writeHead(302, {Location: req.url + '?mode=' + mode + '&tests=' + tests.join('+')})
- res.end()
+ if !req.query.tests and req.url == '/'
+ res.writeHead(302, {Location: req.url + "?mode=#{mode}&tests=" + tests.join('+')})
+ res.end()
+ return
+
+ if +req.query.iter >= PERF_ITERATIONS
+ if (req.query.tests and req.query.tests.length)
+ remainingTests = req.query.tests;
+ res.writeHead(302, {Location: "/?mode=#{mode}&tests=#{remainingTests}"})
+ else
+ res.writeHead(302, {Location: "/done"})
+ res.end()
+ return
+
+
+ if (req.query.perf)
+ url = req.url.split('?')[0].split('/').pop().replace(/\.html$/, '')
+ console.log('RECORDING', url)
+ req.session[url] = (req.session[url] || '') + req.query.perf + '\n'
+ next()
)
.use(Connect.static integrationDir)
.use(Connect.middleware.logger((request, result) ->
@@ -65,17 +87,14 @@ start = (mode) ->
)
)
.use('/end', (req, res) ->
- res.end logRequests()
+ res.end(logRequests())
)
- .use('/submit', (req, res) ->
- body = ''
- req.on('data', (data) ->
- body += data;
- )
- req.on('end', () ->
- console.log(body)
- res.end
- )
+ .use('/done', (req, res) ->
+ for key in tests
+ results = JSON.parse('[' + req.session[key].split('\n').join(',') + '0]')
+ results.pop()
+ res.write(key + '\n' + analyzeDeltas(results) + '\n')
+ res.end()
)
.use('/start', (req, res) ->
logRequests()
@@ -86,7 +105,7 @@ start = (mode) ->
project = Project.load "test/integration/#{mode}#{target}/project.json"
project.build_directory = "test/integration/#{mode}#{target}/bld"
- project.build({ test: true, }, (err) ->
+ project.build({ test: true, production:false }, (err) ->
if err
error = "Failed to build #{target}. Error: #{err}"
console.log(error)
View
1  test/integration/performance/02.basicResource/bld/mobify.js
@@ -0,0 +1 @@
+(function(e){var t={},n=0,r=function(){return"_generatedID_"+n++},i=!navigator.userAgent.match(/webkit/i),s=function(e,n){var r=t[e]=t[e]||[];r.push(n)},o=e.ark={store:function(e,t,n){typeof e=="function"&&(n=t,t=e,e=r()),!n&&t.call?(i&&s(e,t),t()):s(e,t)},load:function(n){var r=[];if(n){var i=n.split(/[ ,]/);for(var s=0,o=i.length;s<o;++s){var u=t[i[s]];if(!u)continue;for(var a=0,f=u.length;a<f;++a){var l=u[a];l.call&&(l="("+l+")()"),r.push("<script>"+l+"</script>")}}}else for(var c in t)r.push(e.ark.load(c));return r.join("\n")},dustSection:function(e,t,n,r){var i=o.load(r&&r.name);return e.write(i)}}})(Mobify),Mobify.ark.store("jquery",function(){window.Mobify=window.Mobify||{},function(e){String.prototype.trim===e&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===e&&(Array.prototype.reduce=function(t){if(this===void 0||this===null)throw new TypeError;var n=Object(this),r=n.length>>>0,i=0,s;if(typeof t!="function")throw new TypeError;if(r==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)s=arguments[1];else do{if(i in n){s=n[i++];break}if(++i>=r)throw new TypeError}while(!0);while(i<r)i in n&&(s=t.call(e,s,n[i],i,n)),i++;return s})}();var Zepto=function(){function k(e){return S.call(e)=="[object Function]"}function L(e){return e instanceof Object}function A(e){return L(e)&&e.__proto__==Object.prototype}function O(e){return e instanceof Array}function M(e){return typeof e.length=="number"}function _(t){return t.filter(function(t){return t!==e&&t!==null})}function D(e){return e.length>0?n.fn.concat.apply([],e):e}function P(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function H(e){return e in a?a[e]:a[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function B(e,t){return typeof t=="number"&&!l[P(e)]?t+"px":t}function j(e){var t,n;return u[e]||(t=o.createElement(e),o.body.appendChild(t),n=f(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),n=="none"&&(n="block"),u[e]=n),u[e]}function F(t,r){return r===e?n(t):n(t).filter(r)}function I(e,t,n,r){return k(t)?t.call(e,n,r):t}function q(e,t,r){var i=e%2?t:t.parentNode;i?i.insertBefore(r,e?e==1?i.firstChild:e==2?t:null:t.nextSibling):n(r).remove()}function R(e,t){t(e);for(var n in e.childNodes)R(e.childNodes[n],t)}var e,t,n,r,i=[],s=i.slice,o=window.document,u={},a={},f=o.defaultView.getComputedStyle,l={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},c=/^\s*<(\w+|!)[^>]*>/,h=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,p=[1,3,8,9,11],d=["after","prepend","before","append"],v=o.createElement("table"),m=o.createElement("tr"),g={tr:o.createElement("tbody"),tbody:v,thead:v,tfoot:v,td:m,th:m,"*":o.createElement("div")},y=/complete|loaded|interactive/,b=/^\.([\w-]+)$/,w=/^#([\w-]+)$/,E=/^[\w-]+$/,S={}.toString,x={},T,N,C=o.createElement("div");return x.matches=function(e,t){if(!e||e.nodeType!==1)return!1;var n=e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,s=!i;return s&&(i=C).appendChild(e),r=~x.qsa(i,t).indexOf(e),s&&C.removeChild(e),r},T=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},N=function(e){return e.filter(function(t,n){return e.indexOf(t)==n})},x.fragment=function(t,r){t.replace&&(t=t.replace(h,"<$1></$2>")),r===e&&(r=c.test(t)&&RegExp.$1),r in g||(r="*");var i=g[r];return i.innerHTML=""+t,n.each(s.call(i.childNodes),function(){i.removeChild(this)})},x.Z=function(e,t){return e=e||[],e.__proto__=arguments.callee.prototype,e.selector=t||"",e},x.isZ=function(e){return e instanceof x.Z},x.init=function(t,r){if(!t)return x.Z();if(k(t))return n(o).ready(t);if(x.isZ(t))return t;var i;if(O(t))i=_(t);else if(A(t))i=[n.extend({},t)],t=null;else if(p.indexOf(t.nodeType)>=0||t===window)i=[t],t=null;else if(c.test(t))i=x.fragment(t.trim(),RegExp.$1),t=null;else{if(r!==e)return n(r).find(t);i=x.qsa(o,t)}return x.Z(i,t)},n=function(e,t){return x.init(e,t)},n.extend=function(n){return s.call(arguments,1).forEach(function(r){for(t in r)r[t]!==e&&(n[t]=r[t])}),n},x.qsa=function(e,t){var n;return e===o&&w.test(t)?(n=e.getElementById(RegExp.$1))?[n]:i:e.nodeType!==1&&e.nodeType!==9?i:s.call(b.test(t)?e.getElementsByClassName(RegExp.$1):E.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t))},n.isFunction=k,n.isObject=L,n.isArray=O,n.isPlainObject=A,n.inArray=function(e,t,n){return i.indexOf.call(t,e,n)},n.trim=function(e){return e.trim()},n.uuid=0,n.map=function(e,t){var n,r=[],i,s;if(M(e))for(i=0;i<e.length;i++)n=t(e[i],i),n!=null&&r.push(n);else for(s in e)n=t(e[s],s),n!=null&&r.push(n);return D(r)},n.each=function(e,t){var n,r;if(M(e)){for(n=0;n<e.length;n++)if(t.call(e[n],n,e[n])===!1)return e}else for(r in e)if(t.call(e[r],r,e[r])===!1)return e;return e},n.fn={forEach:i.forEach,reduce:i.reduce,push:i.push,indexOf:i.indexOf,concat:i.concat,map:function(e){return n.map(this,function(t,n){return e.call(t,n,t)})},slice:function(){return n(s.apply(this,arguments))},ready:function(e){return y.test(o.readyState)?e(n):o.addEventListener("DOMContentLoaded",function(){e(n)},!1),this},get:function(t){return t===e?s.call(this):this[t]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(e){return this.forEach(function(t,n){e.call(t,n,t)}),this},filter:function(e){return k(e)?this.not(this.not(e)):n([].filter.call(this,function(t){return x.matches(t,e)}))},add:function(e,t){return n(N(this.concat(n(e,t))))},is:function(e){return this.length>0&&x.matches(this[0],e)},not:function(t){var r=[];if(k(t)&&t.call!==e)this.each(function(e){t.call(this,e)||r.push(this)});else{var i=typeof t=="string"?this.filter(t):M(t)&&k(t.item)?s.call(t):n(t);this.forEach(function(e){i.indexOf(e)<0&&r.push(e)})}return n(r)},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!L(e)?e:n(e)},last:function(){var e=this[this.length-1];return e&&!L(e)?e:n(e)},find:function(e){var t;return this.length==1?t=x.qsa(this[0],e):t=this.map(function(){return x.qsa(this,e)}),n(t)},closest:function(e,t){var r=this[0];while(r&&!x.matches(r,e))r=r!==t&&r!==o&&r.parentNode;return n(r)},parents:function(e){var t=[],r=this;while(r.length>0)r=n.map(r,function(e){if((e=e.parentNode)&&e!==o&&t.indexOf(e)<0)return t.push(e),e});return F(t,e)},parent:function(e){return F(N(this.pluck("parentNode")),e)},children:function(e){return F(this.map(function(){return s.call(this.children)}),e)},contents:function(){return n(this.map(function(){return s.call(this.childNodes)}))},siblings:function(e){return F(this.map(function(e,t){return s.call(t.parentNode.children).filter(function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return this.map(function(){return this[e]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),f(this,"").getPropertyValue("display")=="none"&&(this.style.display=j(this.nodeName))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return this.each(function(){n(this).wrapAll(n(e)[0].cloneNode(!1))})},wrapAll:function(e){return this[0]&&(n(this[0]).before(e=n(e)),e.append(this)),this},wrapInner:function(e){return this.each(function(){var t=n(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return n(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(t){return(t===e?this.css("display")!="none":!t)?this.hide():this.show()},prev:function(e){return n(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return n(this.pluck("nextElementSibling")).filter(e||"*")},html:function(t){return t===e?this.length>0?this[0].innerHTML:null:this.each(function(e){var r=this.innerHTML;n(this).empty().append(I(this,t,e,r))})},text:function(t){return t===e?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(n,r){var i;return typeof n=="string"&&r===e?this.length==0||this[0].nodeType!==1?e:n=="value"&&this[0].nodeName=="INPUT"?this.val():!(i=this[0].getAttribute(n))&&n in this[0]?this[0][n]:i:this.each(function(e){if(this.nodeType!==1)return;if(L(n))for(t in n)this.setAttribute(t,n[t]);else this.setAttribute(n,I(this,r,e,this.getAttribute(n)))})},removeAttr:function(e){return this.each(function(){this.nodeType===1&&this.removeAttribute(e)})},prop:function(t,n){return n===e?this[0]?this[0][t]:e:this.each(function(e){this[t]=I(this,n,e,this[t])})},data:function(t,n){var r=this.attr("data-"+P(t),n);return r!==null?r:e},val:function(t){return t===e?this.length>0?this[0].multiple?n(this[0]).find("option").filter(function(e){return this.selected}).pluck("value"):this[0].value:e:this.each(function(e){this.value=I(this,t,e,this.value)})},offset:function(){if(this.length==0)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:e.width,height:e.height}},css:function(n,r){if(r===e&&typeof n=="string")return this.length==0?e:this[0].style[T(n)]||f(this[0],"").getPropertyValue(n);var i="";for(t in n)typeof n[t]=="string"&&n[t]==""?this.each(function(){this.style.removeProperty(P(t))}):i+=P(t)+":"+B(t,n[t])+";";return typeof n=="string"&&(r==""?this.each(function(){this.style.removeProperty(P(n))}):i=P(n)+":"+B(n,r)),this.each(function(){this.style.cssText+=";"+i})},index:function(e){return e?this.indexOf(n(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return this.length<1?!1:H(e).test(this[0].className)},addClass:function(e){return this.each(function(t){r=[];var i=this.className,s=I(this,e,t,i);s.split(/\s+/g).forEach(function(e){n(this).hasClass(e)||r.push(e)},this),r.length&&(this.className+=(i?" ":"")+r.join(" "))})},removeClass:function(t){return this.each(function(n){if(t===e)return this.className="";r=this.className,I(this,t,n,r).split(/\s+/g).forEach(function(e){r=r.replace(H(e)," ")}),this.className=r.trim()})},toggleClass:function(t,r){return this.each(function(i){var s=I(this,t,i,this.className);(r===e?!n(this).hasClass(s):!!r)?n(this).addClass(s):n(this).removeClass(s)})}},["width","height"].forEach(function(t){n.fn[t]=function(r){var i,s=t.replace(/./,function(e){return e[0].toUpperCase()});return r===e?this[0]==window?window["inner"+s]:this[0]==o?o.documentElement["offset"+s]:(i=this.offset())&&i[t]:this.each(function(e){var i=n(this);i.css(t,I(this,r,e,i[t]()))})}}),d.forEach(function(e,t){n.fn[e]=function(){var e=n.map(arguments,function(e){return L(e)?e:x.fragment(e)});if(e.length<1)return this;var r=this.length,i=r>1,s=t<2;return this.each(function(n,o){for(var u=0;u<e.length;u++){var a=e[s?e.length-u-1:u];R(a,function(e){e.nodeName!=null&&e.nodeName.toUpperCase()==="SCRIPT"&&(!e.type||e.type==="text/javascript")&&window.eval.call(window,e.innerHTML)}),i&&n<r-1&&(a=a.cloneNode(!0)),q(t,o,a)}})},n.fn[t%2?e+"To":"insert"+(t?"Before":"After")]=function(t){return n(t)[e](this),this}}),x.Z.prototype=n.fn,x.camelize=T,x.uniq=N,n.zepto=x,n}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(e){function t(e){var t=this.os={},n=this.browser={},r=e.match(/WebKit\/([\d.]+)/),i=e.match(/(Android)\s+([\d.]+)/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),u=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),a=u&&e.match(/TouchPad/),f=e.match(/Kindle\/([\d.]+)/),l=e.match(/Silk\/([\d._]+)/),c=e.match(/(BlackBerry).*Version\/([\d.]+)/);if(n.webkit=!!r)n.version=r[1];i&&(t.android=!0,t.version=i[2]),o&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),u&&(t.webos=!0,t.version=u[2]),a&&(t.touchpad=!0),c&&(t.blackberry=!0,t.version=c[2]),f&&(t.kindle=!0,t.version=f[1]),l&&(n.silk=!0,n.version=l[1]),!l&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0)}t.call(e,navigator.userAgent),e.__detect=t}(Zepto),function(e){function s(e){return e._zid||(e._zid=r++)}function o(e,t,r,i){t=u(t);if(t.ns)var o=a(t.ns);return(n[s(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||o.test(e.ns))&&(!r||s(e.fn)===s(r))&&(!i||e.sel==i)})}function u(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function a(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function f(t,n,r){e.isObject(t)?e.each(t,r):t.split(/\s/).forEach(function(e){r(e,n)})}function l(t,r,i,o,a,l){l=!!l;var c=s(t),h=n[c]||(n[c]=[]);f(r,i,function(n,r){var i=a&&a(r,n),s=i||r,f=function(e){var n=s.apply(t,[e].concat(e.data));return n===!1&&e.preventDefault(),n},c=e.extend(u(n),{fn:r,proxy:f,sel:o,del:i,i:h.length});h.push(c),t.addEventListener(c.e,f,l)})}function c(e,t,r,i){var u=s(e);f(t||"",r,function(t,r){o(e,t,r,i).forEach(function(t){delete n[u][t.i],e.removeEventListener(t.e,t.proxy,!1)})})}function v(t){var n=e.extend({originalEvent:t},t);return e.each(d,function(e,r){n[e]=function(){return this[r]=h,t[e].apply(t,arguments)},n[r]=p}),n}function m(e){if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var t=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0,t.call(this)}}}var t=e.zepto.qsa,n={},r=1,i={};i.click=i.mousedown=i.mouseup=i.mousemove="MouseEvents",e.event={add:l,remove:c},e.proxy=function(t,n){if(e.isFunction(t)){var r=function(){return t.apply(n,arguments)};return r._zid=s(t),r}if(typeof n=="string")return e.proxy(t[n],t);throw new TypeError("expected function")},e.fn.bind=function(e,t){return this.each(function(){l(this,e,t)})},e.fn.unbind=function(e,t){return this.each(function(){c(this,e,t)})},e.fn.one=function(e,t){return this.each(function(n,r){l(this,e,t,null,function(e,t){return function(){var n=e.apply(r,arguments);return c(r,t,e),n}})})};var h=function(){return!0},p=function(){return!1},d={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,n,r){var i=!1;if(n=="blur"||n=="focus")e.iswebkit?n=n=="blur"?"focusout":n=="focus"?"focusin":n:i=!0;return this.each(function(s,o){l(o,n,r,t,function(n){return function(r){var i,s=e(r.target).closest(t,o).get(0);if(s)return i=e.extend(v(r),{currentTarget:s,liveFired:o}),n.apply(s,[i].concat([].slice.call(arguments,1)))}},i)})},e.fn.undelegate=function(e,t,n){return this.each(function(){c(this,t,n,e)})},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,r){return n==undefined||e.isFunction(n)?this.bind(t,n||r):this.delegate(n,t,r)},e.fn.off=function(t,n,r){return n==undefined||e.isFunction(n)?this.unbind(t,n||r):this.undelegate(n,t,r)},e.fn.trigger=function(t,n){return typeof t=="string"&&(t=e.Event(t)),m(t),t.data=n,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(t)})},e.fn.triggerHandler=function(t,n){var r,i;return this.each(function(s,u){r=v(typeof t=="string"?e.Event(t):t),r.data=n,r.target=u,e.each(o(u,t.type||t),function(e,t){i=t.proxy(r);if(r.isImmediatePropagationStopped())return!1})}),i},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return this.bind(t,e)}}),["focus","blur"].forEach(function(t){e.fn[t]=function(e){if(e)this.bind(t,e);else if(this.length)try{this.get(0)[t]()}catch(n){}return this}}),e.Event=function(e,t){var n=document.createEvent(i[e]||"Events"),r=!0;if(t)for(var s in t)s=="bubbles"?r=!!t[s]:n[s]=t[s];return n.initEvent(e,r,!0,null,null,null,null,null,null,null,null,null,null,null,null),n}}(Zepto),function(e,t){function c(e){return e.toLowerCase()}function h(e){return r?r+e:c(e)}var n="",r,i,s,o={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},u=window.document,a=u.createElement("div"),f=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,l={};e.each(o,function(e,i){if(a.style[e+"TransitionProperty"]!==t)return n="-"+c(e)+"-",r=i,!1}),l[n+"transition-property"]=l[n+"transition-duration"]=l[n+"transition-timing-function"]=l[n+"animation-name"]=l[n+"animation-duration"]="",e.fx={off:r===t&&a.style.transitionProperty===t,cssPrefix:n,transitionEnd:h("TransitionEnd"),animationEnd:h("AnimationEnd")},e.fn.animate=function(t,n,r,i){return e.isObject(n)&&(r=n.easing,i=n.complete,n=n.duration),n&&(n/=1e3),this.anim(t,n,r,i)},e.fn.anim=function(r,i,s,o){var u,a={},c,h=this,p,d=e.fx.transitionEnd;i===t&&(i=.4),e.fx.off&&(i=0);if(typeof r=="string")a[n+"animation-name"]=r,a[n+"animation-duration"]=i+"s",d=e.fx.animationEnd;else{for(c in r)f.test(c)?(u||(u=[]),u.push(c+"("+r[c]+")")):a[c]=r[c];u&&(a[n+"transform"]=u.join(" ")),!e.fx.off&&typeof r=="object"&&(a[n+"transition-property"]=Object.keys(r).join(", "),a[n+"transition-duration"]=i+"s",a[n+"transition-timing-function"]=s||"linear")}return p=function(t){if(typeof t!="undefined"){if(t.target!==t.currentTarget)return;e(t.target).unbind(d,arguments.callee)}e(this).css(l),o&&o.call(this)},i>0&&this.bind(d,p),setTimeout(function(){h.css(a),i<=0&&setTimeout(function(){h.each(function(){p.call(this)})},0)},0),this},a=null}(Zepto),function($){function triggerAndReturn(e,t,n){var r=$.Event(t);return $(e).trigger(r,n),!r.defaultPrevented}function triggerGlobal(e,t,n,r){if(e.global)return triggerAndReturn(t||document,n,r)}function ajaxStart(e){e.global&&$.active++===0&&triggerGlobal(e,null,"ajaxStart")}function ajaxStop(e){e.global&&!--$.active&&triggerGlobal(e,null,"ajaxStop")}function ajaxBeforeSend(e,t){var n=t.context;if(t.beforeSend.call(n,e,t)===!1||triggerGlobal(t,n,"ajaxBeforeSend",[e,t])===!1)return!1;triggerGlobal(t,n,"ajaxSend",[e,t])}function ajaxSuccess(e,t,n){var r=n.context,i="success";n.success.call(r,e,i,t),triggerGlobal(n,r,"ajaxSuccess",[t,n,e]),ajaxComplete(i,t,n)}function ajaxError(e,t,n,r){var i=r.context;r.error.call(i,n,t,e),triggerGlobal(r,i,"ajaxError",[n,r,e]),ajaxComplete(t,n,r)}function ajaxComplete(e,t,n){var r=n.context;n.complete.call(r,t,e),triggerGlobal(n,r,"ajaxComplete",[t,n]),ajaxStop(n)}function empty(){}function mimeToDataType(e){return e&&(e==htmlType?"html":e==jsonType?"json":scriptTypeRE.test(e)?"script":xmlTypeRE.test(e)&&"xml")||"text"}function appendQuery(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function serializeData(e){isObject(e.data)&&(e.data=$.param(e.data)),e.data&&(!e.type||e.type.toUpperCase()=="GET")&&(e.url=appendQuery(e.url,e.data))}function serialize(e,t,n,r){var i=$.isArray(t);$.each(t,function(t,s){r&&(t=n?r:r+"["+(i?"":t)+"]"),!r&&i?e.add(s.name,s.value):(n?$.isArray(s):isObject(s))?serialize(e,s,n,t):e.add(t,s)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(e){var t="jsonp"+ ++jsonpID,n=document.createElement("script"),r=function(){$(n).remove(),t in window&&(window[t]=empty),ajaxComplete("abort",i,e)},i={abort:r},s;return e.error&&(n.onerror=function(){i.abort(),e.error()}),window[t]=function(r){clearTimeout(s),$(n).remove(),delete window[t],ajaxSuccess(r,i,e)},serializeData(e),n.src=e.url.replace(/=\?/,"="+t),$("head").append(n),e.timeout>0&&(s=setTimeout(function(){i.abort(),ajaxComplete("timeout",i,e)},e.timeout)),i},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(e,t){return $.ajax({url:e,success:t})},$.post=function(e,t,n,r){return $.isFunction(t)&&(r=r||n,n=t,t=null),$.ajax({type:"POST",url:e,data:t,success:n,dataType:r})},$.getJSON=function(e,t){return $.ajax({url:e,success:t,dataType:"json"})},$.fn.load=function(e,t){if(!this.length)return this;var n=this,r=e.split(/\s/),i;return r.length>1&&(e=r[0],i=r[1]),$.get(e,function(e){n.html(i?$(document.createElement("div")).html(e.replace(rscript,"")).find(i).html():e),t&&t.call(n)}),this};var escape=encodeURIComponent;$.param=function(e,t){var n=[];return n.add=function(e,t){this.push(escape(e)+"="+escape(t))},serialize(n,e,t),n.join("&").replace("%20","+")}}(Zepto),function(e){e.fn.serializeArray=function(){var t=[],n;return e(Array.prototype.slice.call(this.get(0).elements)).each(function(){n=e(this);var r=n.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&r!="submit"&&r!="reset"&&r!="button"&&(r!="radio"&&r!="checkbox"||this.checked)&&t.push({name:n.attr("name"),value:n.val()})}),t},e.fn.serialize=function(){var e=[];return this.serializeArray().forEach(function(t){e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e.join("&")},e.fn.submit=function(t){if(t)this.bind("submit",t);else if(this.length){var n=e.Event("submit");this.eq(0).trigger(n),n.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(e){function i(t){return t=e(t),(!!t.width()||!!t.height())&&t.css("display")!=="none"}function u(e,t){var n,r,i=e.match(o);if(i&&i[2]in s){var n=s[i[2]],r=i[3];e=i[1];if(r){var u=Number(r);isNaN(u)?r=r.replace(/^["']|["']$/g,""):r=u}}return t(e,n,r)}var t=e.zepto,n=t.qsa,r=t.matches,s=t.cssFilters={visible:function(){if(i(this))return this},hidden:function(){if(!i(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(e===0)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,n){if(e===n)return this},contains:function(t,n,r){if(e(this).text().indexOf(r)>-1)return this},has:function(e,n,r){if(t.qsa(this,r).length)return this}},o=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*");t.qsa=function(r,i){return u(i,function(s,o,u){try{!s&&o&&(s="*");var a=n(r,s)}catch(f){throw console.error("error performing selector: %o",i),f}return o?t.uniq(e.map(a,function(e,t){return o.call(e,t,a,u)})):a})},t.matches=function(e,t){return u(t,function(t,n,i){return(!t||r(e,t))&&(!n||n.call(e,null,i)===e)})}}(Zepto),function(e){e.fn.end=function(){return this.prevObject||e()},e.fn.andSelf=function(){return this.add(this.prevObject||e())},"filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings".split(",").forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=n.apply(this,arguments);return e.prevObject=this,e}})}(Zepto),function(){var e=[],t=window.Zepto;if(!t||e.__proto__)return;var n=function(n){return e.push.apply(this,n),this};t.zepto.Z=function(e,t){e=e||[];var r=new n(e);return r.selector=t||"",r},t.zepto.Z.prototype=n.prototype=t.fn,t.fn.concat=function(){var e=[];return e.push.apply(e,this),t.each(arguments,function(t,n){typeof n=="object"&&typeof n.length=="number"?e.push.apply(e,n):e.push(n)}),e},t.fn.empty=function(){return this.each(function(e,t){while(t.firstChild)t.removeChild(t.firstChild)})};var r=/^\s*<(\w+)[^>]*>/,i=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,s={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],"*":[0,"",""]};s.optgroup=s.option,s.tbody=s.tfoot=s.colgroup=s.caption=s.thead,s.th=s.td,t.zepto.fragment=function(t,n){n===undefined&&(n=r.test(t)&&RegExp.$1),t=t.toString().replace(i,"<$1></$2>");var o=s[n]||s["*"],u=o[0],a=document.createElement("div");a.innerHTML=o[1]+t+o[2];while(u--)a=a.lastChild;return e.slice.call(a.childNodes)}}(),$.noConflict?Mobify.$=$.noConflict(!0):(Mobify.$=window.Zepto,Mobify.$.support=Mobify.$.support||{},Zepto===$&&delete window.$,delete window.Zepto)},!1),Mobify.ark.store("lib",'(function(e,t,n,r){function m(t,r){function S(e,t){var n=b+e*-1;x(n,t)}function x(e,t){e<0&&(e=0),e>=y&&(e=y-1);if(t||e!=b){if(!t){l.trigger("indexchange",[e,b]);if(c.focus){var r=n(c.focus).offset();r&&n("body").animate({scrollTop:r.top},250)}var i=g.slice(0,e+1+c.lazyLookahead).find("img[lazysrc]");i.each(function(e,t){this.setAttribute("src",this.getAttribute("lazysrc")),this.removeAttribute("lazysrc")})}b=e;var s=g.eq(b),o=g.eq(0),u=s.offset().left,a=o.offset().left,f=s.width(),p=o.width(),v=parseInt(o.parent().css("marginLeft"))||0;w=-(u-a-(f-p)*(v/p))}h[d]=c.duration,E()}function O(e){s.touch||e.preventDefault(),T=!0,N=!1,C=o(e),k=0,L=0,A=!1,h[d]="0s"}function M(e){if(!T||N)return;var t=o(e);k=C.x-t.x,L=C.y-t.y;if(A||i(k)>i(L)&&i(k)>c.minDragDelta){A=!0,e.preventDefault();if(b==0&&k<0||b==y-1&&k>0)k*=.4;E(w-k)}else i(L)>i(k)&&i(L)>c.minDragDelta&&(N=!0)}function _(e){T=!1;var t=i(k),n=0;t>i(L)&&t>c.minMoveDelta&&(n=t>g.eq(b).width()?2:1,n*=k>0?-1:1),S(n)}function D(e){A&&e.preventDefault()}function P(){T&&_()}function H(){setTimeout(function(){S(0,!0)},1)}var l=n(t);if(l.data("slide"))return;l.data("slide",!0);var c=n.extend({},m.defaults,r),h=l[0].style,g=l.children(),y=g.length,b=0,w=0,E=v?function(e){t.style[p]=a+(e||w)+f}:function(e){h.left=(e||w)+"px"};E();var T=!1,N=!1,C,k,L,A;n(e).bind("orientationchange.slide",H),l.bind(u.down+".slide",O).bind(u.move+".slide",M).bind(u.up+".slide",_).bind("click.slide",D).bind("slidemove.slide",function(e,t){S(t)}).bind("indexchange.slide",function(e,t,r){n(c.dots).children().removeClass(c.dotsClass).eq(t).addClass(c.dotsClass)}).trigger("indexchange",[b,b]),s.touch||l.bind("mouseout.slide",P),y<=c.maxDots&&n(c.dots).addClass("on").children().bind("touchstart.slide mouseup.slide",function(e){e.type=="touchstart"&&e.preventDefault(),x(n(this).index())})}function g(t,r){var i=n.extend({},m.defaults,r),s=n(t);s.unbind(".slide").data("slide",!1),n(e).unbind(".slide"),n(i.dots).unbind(".slide")}n.extend(n.support,{touch:"ontouchend"in t,transitions3d:!!(e.WebKitCSSMatrix&&"m11"in new WebKitCSSMatrix)});var i=Math.abs,s=n.support,o=s.touch?function(e){return e=e.originalEvent||e,{x:e.touches[0].clientX,y:e.touches[0].clientY}}:function(e){return{x:e.clientX,y:e.clientY}},u=s.touch?{down:"touchstart",move:"touchmove",up:"touchend"}:{down:"mousedown",move:"mousemove",up:"mouseup"};n.support.events=u;var a="translate"+(s.transitions3d?"3d(":"("),f=s.transitions3d?"px,0,0)":"px,0)",l=["Webkit","Moz","O","ms",""],c=t.createElement("div").style,h=function(e){for(var t=0;t<l.length;++t)if(c[l[t]+e]!==r)return l[t]+e},p=h("Transform"),d=h("TransitionDuration"),v=!!p;m.defaults={minDragDelta:10,minMoveDelta:20,dots:".x-slide-dots",dotsClass:"x-current",maxDots:12,duration:"0.5s",lazyLookahead:1},n.fn.slide=function(e){return this.each(function(){m(this,e)})},n.fn.unslide=function(e){return this.each(function(){g(this,e)})},t.addEventListener("DOMContentLoaded",function y(){t.removeEventListener("DOMContentLoaded",y,!1),n(".x-slide-items").slide()},!1)})(window,document,Mobify.$)',!0),function(){var e=location.hash,t=/mobify-path=([^&;]+)/g.exec(e);if(t){var n=t[1];/mobify-all/.test(e)?document.cookie="mobify-path="+n+"; path=/":(document.cookie="mobify-path=1; path=/",sessionStorage["mobify-path"]=n)}}(),function(e,t){var n=e.console=window.console;n.group||(n.group=n.log,n.groupEnd=function(){}),t.extend(n,{die:function(){var t=[].slice.call(arguments);throw n.group("(T_T) Fatal error (T_T)"),n.error.apply(n,t),n.groupEnd(),e.config.isDebug||e.unmobify(),t},logGroup:function(e,r,i){var s=!0;t.each(i,function(t,i){s&&n.group(r),typeof t=="number"?n[e].apply(window,i):n[e](t,i),s=!1}),s||n.groupEnd()}})}(Mobify,Mobify.$),function(e,t){t.desktop=function(e){document.cookie="mobify-path; path=/;",e?location=e:location.reload()},t.i18n=function(e,t){e.push("DEFAULT");var n=function(n){for(var r=0;r<e.length;r++){var i=t[e[r]][n];if(i)return i}};return n}}(Mobify.$,Mobify),function(e,t){function r(e){return(" "+ +e+"ms ").slice(-10)}function i(e,t,n){var i=e[0],s=e[1],o=r(i-n[0][0]),u=r(i-(n[t-1]||n[0])[0]);return o+u+s}var n=t.console,s=t.timing={points:[],selectors:[],addPoint:function(e,t){var n=t||+(new Date);return this.points.push([n,e]),n},addSelector:function(e,t){var n=t||+(new Date);this.selectors.push([n,e])},logGroup:function(t,r){var s=t.map(i);n.groupCollapsed?n.groupCollapsed(r):n.group(r),n.dir?n.dir(s):e.each(s,function(e,t){n.log(t)}),n.groupEnd()},logPoints:function(){this.logGroup(this.points,"Global timing"),this.logGroup(this.selectors,"Data evaluation timing")},reset:function(){this.points=[],this.selectors=[]}};s.addPoint("Finished Document",t.points[1]),s.addPoint("Loaded Mobify.js")}(Mobify.$,Mobify),function(e,t){function p(e,t,n){return t=t.toLowerCase(),result="<"+t+(s[t]||"")+n.replace(f[t]," x-$1")+">"}var n=function(t){return e.map(t,function(e,t){return t})},r=function(t){return e.map(t,function(e,t){return e})},i=new RegExp("(<script[\\s\\S]*?>)","gi"),s={style:' media="mobify-media"',script:' type="text/mobify-script"'},o=new RegExp(r(s).join("|"),"g"),u={img:["src"],iframe:["src"],script:["src","type"],link:["href"],style:["media"]},a=new RegExp("<("+n(u).join("|")+")([\\s\\S]*?)>","gi"),f={},l={},c,h=t.html=t.html||{};e.each(u,function(t,n){e.each(n,function(e,t){l[t]=!0}),t==="img"&&(n=n.concat("width","height")),f[t]=new RegExp("\\s+((?:"+n.join("|")+")\\s*=\\s*(?:'([\\s\\S])+?'|\"([\\s\\S])+?\"))","gi")}),c=new RegExp("\\sx-("+n(l).join("|")+")","gi"),e.extend(h,{disable:function(e){var t=/(<!--[\s\S]*?-->)|(?=<\/script)/i,n=e.split(t),r=n.map(function(e){var t;return e?/^<!--/.test(e)?e:(t=e.split(i),t[0]=t[0].replace(a,p),t[1]&&(t[1]=t[1].replace(a,p)),t):""});return[].concat.apply([],r).join("")},enable:function(e){return e.replace(c," $1").replace(o,"")}})}(Mobify.$,Mobify),function(e,t){var n=function(e){return e.nodeName.toLowerCase()},r=function(e){return e.replace('"',"&quot;")},i=function(e){if(!e)return"";e.length&&(e=e[0]);var t=[];return[].forEach.call(e.attributes,function(e){t.push(" ",e.name,'="',r(e.value),'"')}),"<"+n(e)+t.join("")+">"},s=function(e){return e?(e.length&&(e=e[0]),"</"+n(e)+">"):""},o=function(e){var t=e.doctype||[].filter.call(e.childNodes,function(e){return e.nodeType==Node.DOCUMENT_TYPE_NODE})[0];return t?"<!DOCTYPE HTML"+(t.publicId?' PUBLIC "'+t.publicId+'"':"")+(t.systemId?' "'+t.systemId+'"':"")+">":""},u=function(e){return e?[].map.call(e.childNodes,function(e){var t=n(e);return t=="#comment"?"<!--"+e.textContent+"-->":t=="plaintext"?e.textContent:t=="script"&&(/mobify\./.test(e.src)||/Mobify/.test(e.textContent))?"":e.outerHTML||e.nodeValue}).join(""):""},a,f=function(t){if(a)return a;var t=t||e,n=t.getElementsByTagName("head")[0]||t.createElement("head"),r=t.getElementsByTagName("body")[0]||t.createElement("body"),s=t.getElementsByTagName("html")[0];return a={doctype:o(t),htmlTag:i(s),headTag:i(n),bodyTag:i(r),headContent:u(n),bodyContent:u(r)},a.all=function(){return this.doctype+this.htmlTag+this.headTag+this.headContent+this.bodyContent},a},l=t.unmobify=function(t){t=t||e,/complete|loaded/.test(t.readyState)?c(t):t.addEventListener("DOMContentLoaded",c,!1)},c=function(t){t=t&&t.target||t||e,t.removeEventListener("DOMContentLoaded",c,!1);var n=f(t);setTimeout(function(){t.open(),t.write(n.all()),t.close()},15)},h=t.html||{};t.$?t.$.extend(h,{extractHTML:f,extractHTMLFromElement:u,openTag:i,closeTag:s}):(t.api=1,l())}(document,Mobify),function(e,t){var n=function(t){var n=/<!--(?:[\s\S]*?)-->|(<\/head\s*>|<body[\s\S]*$)/gi;t=e.extend({},t);var r=t.bodyContent=t.headContent+t.bodyContent;t.headContent="";for(var i;i=n.exec(r);i){if(!i[1])continue;if(i[1][1]!="/"){t.headContent=t.head||r.slice(0,i.index),t.bodyContent=i[0];var s=/^((?:[^>'"]*|'[^']*?'|"[^"]*?")*>)([\s\S]*)$/.exec(i[0]);s&&(t.bodyTag=s[1],t.bodyContent=s[2]);break}t.headContent=r.slice(0,i.index),t.bodyContent=r.slice(i.index+i[1].length)}return t},r=function(t){var n=t.match(/^<(\w+)([\s\S]*)/i),r=document.createElement(n[1]);return e.each(e("<div"+n[2])[0].attributes,function(e,t){r.setAttribute(t.nodeName,t.nodeValue)}),e(r)},i=t.html||{};e.extend(i,{extractDOM:function(){var e=n(i.extractHTML());t.timing.addPoint("Recovered Markup");var s=this.disable(e.headContent),o=this.disable(e.bodyContent);t.timing.addPoint("Disabled Markup");var u={doctype:e.doctype};return u.$head=r(e.headTag).append(s),u.$body=r(e.bodyTag).append(o),u.$html=r(e.htmlTag).append(u.$head,u.$body),t.timing.addPoint("Built Passive DOM"),u}})}(Mobify.$,Mobify);var dust={};(function(dust){function Context(e,t,n){this.stack=e,this.global=t,this.blocks=n}function Stack(e,t,n,r){this.tail=t,this.isObject=!dust.isArray(e)&&e&&typeof e=="object",this.head=e,this.index=n,this.of=r}function Stub(e){this.head=new Chunk(this),this.callback=e,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(e,t,n){this.root=e,this.next=t,this.data="",this.flushable=!1,this.taps=n}function Tap(e,t){this.head=e,this.tail=t}dust.cache={},dust.register=function(e,t){if(!e)return;dust.cache[e]=t},dust.render=function(e,t,n){var r=(new Stub(n)).head;dust.load(e,r,Context.wrap(t)).end()},dust.stream=function(e,t){var n=new Stream;return dust.nextTick(function(){dust.load(e,n.head,Context.wrap(t)).end()}),n},dust.renderSource=function(e,t,n){return dust.compileFn(e)(t,n)},dust.compileFn=function(e,t){var n=dust.loadSource(dust.compile(e,t));return function(e,t){var r=t?new Stub(t):new Stream;return dust.nextTick(function(){n(r.head,Context.wrap(e)).end()}),r}},dust.load=function(e,t,n){var r=dust.cache[e];return r?r(t,n):dust.onLoad?t.map(function(t){dust.onLoad(e,function(r,i){if(r)return t.setError(r);dust.cache[e]||dust.loadSource(dust.compile(i,e)),dust.cache[e](t,n).end()})}):t.setError(new Error("Template Not Found: "+e))},dust.loadSource=function(source,path){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(e){return Object.prototype.toString.call(e)=="[object Array]"},dust.nextTick=function(e){setTimeout(e,0)},dust.isEmpty=function(e){return dust.isArray(e)&&!e.length?!0:e===0?!1:!e},dust.filter=function(e,t,n){if(n)for(var r=0,i=n.length;r<i;r++){var s=n[r];s==="s"?t=null:e=dust.filters[s](e)}return t&&(e=dust.filters[t](e)),e},dust.filters={h:function(e){return dust.escapeHtml(e)},j:function(e){return dust.escapeJs(e)},u:encodeURI,uc:encodeURIComponent},dust.makeBase=function(e){return new Context(new Stack,e)},Context.wrap=function(e){return e instanceof Context?e:new Context(new Stack(e))},Context.prototype.get=function(e){var t=this.stack,n;while(t){if(t.isObject){n=t.head[e];if(n!==undefined)return n}t=t.tail}return this.global?this.global[e]:undefined},Context.prototype.getPath=function(e,t){var n=this.stack,r=t.length;if(e&&r===0)return n.head;if(!n.isObject)return undefined;n=n.head;var i=0;while(n&&i<r)n=n[t[i]],i++;return n},Context.prototype.push=function(e,t,n){return new Context(new Stack(e,this.stack,t,n),this.global,this.blocks)},Context.prototype.rebase=function(e){return new Context(new Stack(e),this.global,this.blocks)},Context.prototype.current=function(){return this.stack.head},Context.prototype.getBlock=function(e){var t=this.blocks;if(!t)return;var n=t.length,r;while(n--){r=t[n][e];if(r)return r}},Context.prototype.shiftBlocks=function(e){var t=this.blocks;return e?(t?newBlocks=t.concat([e]):newBlocks=[e],new Context(this.stack,this.global,newBlocks)):this},Stub.prototype.flush=function(){var e=this.head;while(e){if(!e.flushable){if(e.error){this.callback(e.error),this.flush=function(){};return}return}this.out+=e.data,e=e.next,this.head=e}this.callback(null,this.out)},Stream.prototype.flush=function(){var e=this.head;while(e){if(!e.flushable){if(e.error){this.emit("error",e.error),this.flush=function(){};return}return}this.emit("data",e.data),e=e.next,this.head=e}this.emit("end")},Stream.prototype.emit=function(e,t){var n=this.events;n&&n[e]&&n[e](t)},Stream.prototype.on=function(e,t){return this.events||(this.events={}),this.events[e]=t,this},Chunk.prototype.write=function(e){var t=this.taps;return t&&(e=t.go(e)),this.data+=e,this},Chunk.prototype.end=function(e){return e&&this.write(e),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(e){var t=new Chunk(this.root,this.next,this.taps),n=new Chunk(this.root,t,this.taps);return this.next=n,this.flushable=!0,e(n),t},Chunk.prototype.tap=function(e){var t=this.taps;return t?this.taps=t.push(e):this.taps=new Tap(e),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(e,t){return e(this,t)},Chunk.prototype.reference=function(e,t,n,r){if(typeof e=="function"){e=e(this,t,null,{auto:n,filters:r});if(e instanceof Chunk)return e}return dust.isEmpty(e)?this:this.write(dust.filter(e,n,r))},Chunk.prototype.section=function(e,t,n,r){if(typeof e=="function"){e=e(this,t,n,r);if(e instanceof Chunk)return e}var i=n.block,s=n["else"];r&&(t=t.push(r));if(dust.isArray(e)){if(i){var o=e.length,u=this;for(var a=0;a<o;a++)u=i(u,t.push(e[a],a,o));return u}}else if(e===!0){if(i)return i(this,t)}else if(e||e===0){if(i)return i(this,t.push(e))}else if(s)return s(this,t);return this},Chunk.prototype.exists=function(e,t,n){var r=n.block,i=n["else"];if(!dust.isEmpty(e)){if(r)return r(this,t)}else if(i)return i(this,t);return this},Chunk.prototype.notexists=function(e,t,n){var r=n.block,i=n["else"];if(dust.isEmpty(e)){if(r)return r(this,t)}else if(i)return i(this,t);return this},Chunk.prototype.block=function(e,t,n){var r=n.block;return e&&(r=e),r?r(this,t):this},Chunk.prototype.partial=function(e,t){return typeof e=="function"?this.capture(e,t,function(e,n){dust.load(e,n,t).end()}):dust.load(e,this,t)},Chunk.prototype.helper=function(e,t,n,r){return dust.helpers[e](this,t,n,r)},Chunk.prototype.capture=function(e,t,n){return this.map(function(r){var i=new Stub(function(e,t){e?r.setError(e):n(t,r)});e(i.head,t).end()})},Chunk.prototype.setError=function(e){return this.error=e,this.root.flush(),this},dust.helpers={sep:function(e,t,n){return t.stack.index===t.stack.of-1?e:n.block(e,t)},idx:function(e,t,n){return n.block(e,t.push(t.stack.index))}},Tap.prototype.push=function(e){return new Tap(e,this)},Tap.prototype.go=function(e){var t=this;while(t)e=t.head(e),t=t.tail;return e};var HCHARS=new RegExp(/[&<>\"]/),AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g;dust.escapeHtml=function(e){return typeof e=="string"?HCHARS.test(e)?e.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;"):e:e};var BS=/\\/g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;dust.escapeJs=function(e){return typeof e=="string"?e.replace(BS,"\\\\").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):e}})(dust),function(e){var t=Mobify.console,n=function(e,t,n){var r=this.root,i=r.warnings=r.warnings||{},s=r.overwrites=r.overwrites||{},o=n===null||n===undefined||n===""||typeof n.length!="undefined"&&!n.length||n instanceof Error||!n&&this.get("laziness")>0;t&&e.importance>-1&&(o?i[t.crumbs]=n:delete i[t.crumbs],t.value!==undefined&&!t.value._async&&(s[t.crumbs]=n))},r=function(e){this.tail||(t.logGroup("warn","Unfilled values",this.warnings),t.logGroup("warn","Missing -> Wrappers",this.forgotten),t.logGroup("log","Overwrites",this.overwrites),t.logGroup("log","Choices",this.choices),t.group("All extracted data"),t.log(e),t.groupEnd())},i=function(t,n){var r=function(e){var t=arguments;return e.map(function(e){var n=function(n){return t[3]==="exists"?e.exists(n,t[1],t[2]).end():t[3]==="notexists"?e.notexists(n,t[1],t[2]).end():t[2]===null?e.reference(n,t[1],t[3].auto,t[3].filters).end():e.section(n,t[1],t[2],t[3]).end()};i.push(n)})},i=[],s,o;return r.onresult=function(e){o?e.call(r,s):i.push(e)},r.finish=function(t){s=t,o=!0,e.each(i,function(e,n){n.call(r,t)})},r._async=!0,n.call(t.env().head,t,r),o?s:r},s=function(t){var n=function(n,i,s){return t=t||Mobify.conf.data&&Mobify.conf.data.$html,(e.fn.init||e.zepto.init).call(this,n,i||r.context(),s)},r=e.sub(n);return r.context=function(){return t||(Mobify.conf.data?Mobify.conf.data.$html:"<div>")},r.zepto||(r.fn.init=n,r.fn.init.prototype=e.fn),r};e.sub=e.sub||function(t){return e.extend(t,e),t.zepto=e.extend({},e.zepto),t},e.fn.anchor=function(){return s(this)},Mobify.data2={gatherEmpties:n,makeCont:function(t){var i=new Mobify.data2.cont(e.extend({},{laziness:-1},t));return Mobify.config.isDebug&&i.on("assignReference",n).on("complete",r),i},Async:i,M:{$:s(),async:i}}}(Mobify.$),function(e,t){var n=t.data2.stack=function(e,t,n,r){this.tail=t,this.head=e,this.index=n,this.len=r},r=/^[^!?.]*(\.[^!?.]+)*$/i;n.prototype={_mobifyStack:!0,extend:function(e,t,r){return new n(e,this,t,r)},crumbs:function(){var e=[];for(var t=this;t.tail;t=t.tail)t.index!==undefined&&e.unshift(t.index);return e.toString=function(){return this.join(".")},e},get:function(e){var t=this;while(!(e in t.head)&&t.tail)t=t.tail;return t.head&&t.head[e]},set:function(e,t){return this.head[e]=t},ref:function(t,n){var i=(t||"").toString().match(r),s=this,o,u,a,f;if(!i)return;o=i[0].split("."),u=o[0];if(u&&(isNaN(u)||!e.isArray(s.head)))while(!(u in s.head)&&s.tail)s=s.tail;!(u in s.head)&&n&&(s=this),a=s.crumbs(),a.pop(),a.push.apply(a,o),f=s.head;var l=f,c=0;while((tok=o[c++])!==undefined)tok==""?l=f:(f=l,u=tok,l=f?f[tok]:undefined);if(f&&u in f||n)return{target:f,value:l,key:u,crumbs:a}}}}(Mobify.$,Mobify),function(e,t,n){var r=/^([?!]?)(.*)$/,i=window.Location,s=t.data2.stack,o=t.data2.Async,u=t.data2.cont=function(e,t,n,r,i){s.call(this,e,t,n,r);if(!t){var o=this.root=this;this.handlers={},this.pending=0}else this.root=t.root;var u=t&&t.env();i?this.env(u.extend(i,n,r)):u||this.env(new s(i||{}))};e.extend(u,{importance:{"!":1,"?":-1,"":0},decodeAssignment:function(e){return parse=e.toString().match(r),{importance:this.importance[parse[1]],selector:parse[2]}}}),u.prototype=e.extend(new s,{extend:function(e,t,n,r){return new u(e,this,t,n,r)},env:function(e){return e!==n?this.set("env",e):this.get("env")},source:function(e){return e!==n?this.set("source",e):this.get("source")},all:function(){var e;for(e=this.env();e.tail.tail;e=e.tail);return e.head},blankTarget:function(){var t=this.source();if(e.isArray(t))return[];if(e.isPlainObject(t))return{}},_eval:function(e){var t=this.root,n=this.extend({source:e},this.index,this.length),r=n.eval();return r},eval:function(e){if(e!==n)return this._eval(e);var t=this.blankTarget(),r=t?this.evalCollection(t):this.evalLeaf(),i=this.root;return!this.parent&&this===i&&(i.pending?i.incomplete||(i.incomplete=!0,this.on("assignReference",function(){i.pending||i.emit("complete",[this.all(),this])})):i.emit("complete",[r,this])),r},evalLeaf:function(){var t=this.source();try{return t?e.isFunction(t)&&!t._async?t.call(this.env().head,this):t:t}catch(n){return n}},evalCollection:function(t){var n=this.source(),r=n.length,i=this;return e.each(n,function(e,n){if(n&&(n.jquery||n.nodeType)&&typeof e=="string"&&e.indexOf("$")){var s=i.root,o=s.forgotten=s.forgotten||[];o.push([e,n])}i.extend({source:n},e,r,t).evalReference()}),t},evalReference:function(){var e,n,r=this,i=u.decodeAssignment(this.index);if(i.importance>=this.get("laziness")){this.ref=e=this.env().ref(i.selector,!0);if(!e){t.console.warn(i.selector," has a syntax error or points to object that does not exist");return}n=this.eval();if(n&&n._async){e.value=n,e.target&&e.key&&(e.target[e.key]=n);var s=r.root;n.onresult(function(t){s.pending-=1,r.assignReference(i,e,t)}),s.pending+=1}else this.assignReference(i,e,n);return n}return},assignReference:function(e,n,r){return r instanceof Error||(n.target&&n.key?n.target[n.key]=r:this.tail&&(r=new Error(e.selector+" value can't be saved to "+n.crumbs))),this.emit("assignReference",[e,n,r]),t.config.isDebug&&t.timing.addSelector(n.crumbs),r},choose:function(){var e=this,n=e.root,r=n.forgotten=n.forgotten||[],i=arguments,s=n.choices=n.choices||{},o=([].some.call(i,function(r,i){var s=new t.data2.cont({source:r,laziness:1});s.root=s,s.env(e.env().extend({})),s.on("assignReference",t.data2.gatherEmpties).eval(),[].push.apply(n.forgotten,s.forgotten||[]);for(var u in s.warnings)break;return u||(o=r),!u}),o),u=e.extend({source:o},e.index,e.of);if(o)return s[e.ref.crumbs]=u.eval()},map:function(t,n){var r=t.length,i=this,s;return s=e.map(t,function(t,s){var o=i.extend({source:n},s,r,{$:t.tagName&&e(t).anchor(),KEY:s,LEN:r,THIS:t});return o.eval()}),s},ajax:function(n,r){return o(this,function(i,s){e.ajax(i.eval(n)).success(function(n,o,u){if(!r)s.finish(n);else if(typeof n!="string")i.env(i.env().extend({THIS:n})),s.finish(i.eval(r));else{var a=e(t.html.disable(n));i.env(i.env().extend({THIS:a,$:a.anchor()})),s.finish(i.eval(r))}}).error(function(){s.finish(null)})})},tmpl:function(e,n){var r=arguments;return e instanceof Array&&(e=e[0]),o(this,function(i,s){var o=dust.makeBase({lib_import:t.ark.dustSection});r.length==1&&(n=i.all()),dust.render(e,o.push(n),function(e,n){e?(s.finish(n),t.console.die(e)):s.finish(n)})})},data:function(e,t){var r=t===n,i=this.env().ref(e);if(!i)return;return r?i.value:i.target[i.key]=t},on:function(e,t){var n=this.root.handlers,r=n[e]=n[e]||[];return r.push(t),this},emit:function(t,n){var r=this,i=this,s=this.root.handlers;e.each(s[t]||[],function(e,t){t.apply(i,n)})}})}(Mobify.$,Mobify),function(e,t){var n=t.data2&&t.data2.Async,r=dust.makeBase({}).constructor,i=dust.stream("",{}).head.constructor,s=i.prototype.exists,o=i.prototype.notexists,u=i.prototype.block;i.prototype.exists=function(e,t,n){if(typeof e=="function"){e=e(this,t,n,"exists");if(e instanceof i)return e}return s.call(this,e,t,n)},i.prototype.notexists=function(e,t,n){if(typeof e=="function"){e=e(this,t,n,"notexists");if(e instanceof i)return e}return o.call(this,e,t,n)},i.prototype.block=function(t,n,r){var i=t?t.shift():undefined;return i&&(n=new n.constructor(n.stack,e.extend(n.global||{},{_SUPER_:function(e,n,i){return e.block(t,n,r)}}),n.blocks)),u.call(this,i,n,r)};var a=function(t,r,i){while(t&&i<r.length){if(t._async){var s=n(e.noop);return t.onresult.push(function(e){s.result(a(e,r,i))}),s}t=t[r[i]],i++}return t};r.prototype.getAscendablePath=function(e,t){var n=this.stack;return e?this.getPath(e,t):n.isObject?(n=this.get(t[0]),a(n,t,1)):undefined},r.prototype.getBlock=function(t){var n=this.blocks;return n?(n=e.map(n,function(e){return e[t]}),n):[]};var f=function(e){return typeof e!="string"&&typeof e.length=="number"&&!e.tagName};e.extend(dust.filters,{h:function(t){return t?f(t)?e.map(t,dust.filters.h).join(""):typeof t.outerHTML!="undefined"?t.outerHTML:dust.escapeHtml(t):""},innerHTML:function(t){return t?f(t)?e.map(t,function(e){return e.innerHTML||e.nodeValue}).join(""):e(t).html():""},openTag:t.html.openTag,closeTag:t.html.closeTag});var l=function(e,t,n,r){return r?n.block(e,t):n["else"]?n["else"](e,t):e};e.extend(dust.helpers,{first:function(e,t,n){var r=t.stack.index===0;return l(e,t,n,r)},last:function(e,t,n){var r=t.stack.index===t.stack.of-1;return l(e,t,n,r)}});var c=dust.isArray;dust.isArray=function(e){return e&&e.appendTo||c(e)};var h=dust.load;dust.load=function(e,t,n){return e?h.apply(this,arguments):t}}(Mobify.$,Mobify),function(e,t){if(!window.enableStudioJS)return;var n=0,r=function(e){var t=/<![\s\S]*?>|[^<]+|<!--[\s\S]*?-->|(<script)([\s\S]*?<\/script>)|(<\w+)((?:[^>'"]*|'[^']*?'|"[^"]*?")*\/?>)/gi,n=e.replace(t,function(e,n,r,i,s){return i=i||n,s=s||r,i?i+' mobifyjsindex="src'+t++ +'"'+s:e});return n},i=function(e,t){var n=function(r){r.data.command==="html"&&r.data.dest==="page"&&r.data.key===e&&r.source===window&&(window.removeEventListener("message",n,!1),t(r.data.value,r.data.key))};window.addEventListener("message",n,!1)},s=function(e,t){window.postMessage({dest:"extension",command:"html",key:e,value:t},"*")},o=t.emitMarkup;t.emitMarkup=function(e){t.studioJS.get("renderHTML",function(e){o(e)}),t.studioJS.set("resultHTML",e)};var u=t.html.extractHTML;t.html.extractHTML=function(){var n=u(markup);return e.each(n,function(e,t){n[e]=r(t)}),t.studioJS.set("sourceHTML",n.all()),result}}(Mobify.$,Mobify),function(){var e=Mobify.config=Mobify.config||{},t=/mobify-path=([^&;]*)/g.exec(document.cookie);e.isDebug=t&&t[1]?1:0,e.configFile||(e.configFile=Mobify.$('script[src*="mobify.js"]').first().attr("src")||""),e.configDir=e.configFile.replace(/\/[^\/]*$/,"/")}(),Mobify.ark.store("enhance",function(){(function(e,t){var n=t.support.orientation="orientation"in e&&"onorientationchange"in e&&!/android/i.test(navigator.userAgent),r=function(){var e=document.documentElement;return(n?orientation%180:e.clientWidth>e.clientHeight)?"landscape":"portrait"},i,s,o=function(){clearTimeout(s);var n=document.documentElement.clientWidth;if(n==i)return s=setTimeout(o,250);i=n,t(e).trigger("orientationchange"),f()},u=r(),a=[],f=function(){var e=r(),t=u;if(e!=u){u=e;for(var n=0,i=a.length;n<i;++n)a[n](e,t)}},l=n?"orientationchange":"resize",c=n?f:o,h=function(){t(e).unbind(l,c).bind(l,c)};Mobify.orientation=function(e){if(!e)return r();h(),a.push(e)}})(this,Mobify.$),function(e,t,n){var r=n("<div>",{id:"mc-test"}),i=r[0].style,s="ontouchend"in t,o=/(ip(od|ad|hone)|android|nokia|blackberry|webos)/gi.exec(navigator.userAgent),u=o&&(o[2]?"ios":o[1].toLowerCase())||"desktop",a=/ipad|android(?!.*mobile)/i.test(navigator.userAgent),f=u!="desktop"&&!a,l=1,c=["screen and (-webkit-min-device-pixel-ratio:1.5)","screen and (-webkit-min-device-pixel-ratio:2)"];if("devicePixelRatio"in e)l=devicePixelRatio;else if(e.matchMedia)l=matchMedia(c[1]).matches&&2||matchMedia(c[0]).matches&&1.5;else{var h="<style>@media "+c[0]+"{#mc-test{color:red}}"+"@media "+c[1]+"{#mc-test{color:blue}}"+"</style>",p,d;r.hide().html(h).appendTo(t.documentElement),p=r.css("color"),r.remove();if(d=/255(\))?/gi.exec(p))l=d[1]&&2||1.5}var v=Mobify.config||{};v.os=u,v.tablet=a,v.smartphone=f,v.touch=s,v.orientation=Mobify.orientation(),l>1?(v.HD="@2x",v.pixelRatio=l):v.HD="",Mobify.enhance=function(){var e=[u,(s?"":"no")+"touch",Mobify.orientation()];l>1?e.push("hd"+(l+"").replace(/[^\w]/,""),"hd"):e.push("sd"),n("html").addClass("x-"+e.join(" x-")),Mobify.orientation(function(e,t){n("html").removeClass("x-"+t).addClass("x-"+e)})}}(this,document,Mobify.$)},!1),function(e,t,n){var r=n.timing,i=n.transform=n.transform||{};t.extend(n.transform,{prepareConf:function(e){var s=n.html.extractDOM();s.config=n.config;var o=n.conf=e.call(n.data2&&n.data2.M,s,i.acceptData);if(o&&o.data){r.addPoint("Setup Conf"),o.data=t.extend(s,o.data),n.evaluatedData=undefined;var u=n.data2.makeCont({source:s}).on("complete",i.acceptData);r.addPoint("Prepared conf for evaluation"),r.addSelector("Start"),u.eval()}},acceptData:function(e,t){n.evaluatedData||(n.evaluatedData=e,n.evaluatedCont=t,r.addPoint("Evaluated Conf"));var s=typeof e=="string"?e:e.OUTPUTHTML,o=n.html.enable(s||"");r.addPoint("Enabled Markup"),i.emitMarkup(o)},emitMarkup:function(t){r.addPoint("DOMContentLoaded");if(!t)return n.console.warn("Output HTML is empty, unmobifying."),n.unmobify();r.addPoint("Writing Document"),n.config.isDebug&&r.logPoints(),window.setTimeout(function(){e.open(),e.write(t),e.close()})},run:function(t){var r=function(){if(!/complete|loaded/.test(e.readyState))return setTimeout(r,15);n.transform.prepareConf(t)};r()}})}(document,Mobify.$,Mobify),Mobify.timing.addPoint("Walked Mobify.js"),function(e,t){var n=document.createElement("a"),r=["//ir0.mobify.com","//ir1.mobify.com","//ir2.mobify.com","//ir3.mobify.com"],i=Mobify.URLHash=function(e){var t,n=e.length;return t=e.charCodeAt(n-2%n)^e.charCodeAt(n-3%n)^e.charCodeAt(n-5%n)^e.charCodeAt(n-7%n)^e.charCodeAt(n-11%n)^e.charCodeAt(n-13%n)^e.charCodeAt(n-17%n)^e.charCodeAt(n-19%n),t=(t*1103515245%4294967296+12345)%4294967296,t=t<0?t+4294967296:t,t},s=Mobify.getImageURL=function(e,t){t=t||{};var n=r[i(e)%r.length],s=[n];return t.format&&s.push(t.format+(t.quality||"")),t.maxWidth&&(s.push(t.maxWidth),t.maxHeight&&s.push(t.maxHeight)),s.push(e),s.join("/")},o=t.fn.resizeImages=function(r){var i=t.extend(u,typeof r=="object"&&r),o=e.devicePixelRatio,a=this.filter(i.selector).add(this.find(i.selector)),f;return typeof r=="number"&&(i.maxWidth=r),o&&(i.maxWidth&&(i.maxWidth=Math.ceil(i.maxWidth*o)),i.maxHeight&&(i.maxHeight=Math.ceil(i.maxHeight*o))),a.each(function(){if(f=this.getAttribute(i.attribute))n.href=f,this.setAttribute("x-src",s(n.href,i))})},u=o.defaults={selector:"img[x-src]",attribute:"x-src"}}(this,Mobify.$),Mobify.transform.run(function(){var e=this.$,t=this;return{data:e.extend({"?unmobify":!1,mobileViewport:"width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=no;",touchIcon:undefined,formatDetection:["telephone=no","address=no"],cssDir:function(e){return e.data("config.configDir")},imageDir:function(e){return e.data("config.configDir")+"i/"},"?HD":function(e){return e.data("config.HD")},siteConfig:{},buildDate:1342644516893,configName:"",cssName:function(e){return e.data("configName").split("/").pop().split(".")[0]||"stylesheet"}},{OUTPUTHTML:function(e){var t,n,r;return t=e.data("$html"),t.find("iframe, img, script").remove(),n=document.createElement("script"),r=function(){location.search=location.search.replace(/([?&]iter=)(\d+)/,function(e,t,n){return t+ ++n}).replace(/([?&]perf=)([^&]*)/,function(e,t,n){return t+JSON.stringify(Mobify.timing.points)})},n.textContent="("+r+")()",e.data("$body")[0].appendChild(n),t.prop("outerHTML")}})}}),Mobify.api=[1,1]
View
17 test/integration/performance/02.basicResource/src/mobify.konf
@@ -3,8 +3,21 @@
{<data} {
'OUTPUTHTML': function(context) {
- context.data('$html').find('iframe, img, script').remove();
- return context.data('$html').prop('outerHTML')
+ var $html = context.data('$html');
+ $html.find('iframe, img, script').remove();
+
+ var endIteration = document.createElement('script');
+ var inject = function() {
+ location.search = location.search.replace( /([?&]iter=)(\d+)/, function(all, start, index) {
+ return start + ++index
+ }).replace(/([?&]perf=)([^&]*)/, function(all, start, value) {
+ return start + JSON.stringify(Mobify.timing.points);
+ });
+ }
+ endIteration.textContent = '(' + inject + ')()';
+ context.data('$body')[0].appendChild(endIteration);
+
+ return $html.prop('outerHTML')
}
} {/data}
View
12 test/integration/performance/03.beyondtherack-home.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>title</title>
+</head>
+<body>
+ <script src="comradeLaikaRocketDog.js"></script>
+ <img src="comradeLaikaRocketDog.jpg">
+ <iframe src="comradeLaikaRocketDog.jpg"></iframe>
+
+</body>
+</head>
View
1  test/integration/performance/03.beyondtherack-home/bld/mobify.js
@@ -0,0 +1 @@
+(function(e){var t={},n=0,r=function(){return"_generatedID_"+n++},i=!navigator.userAgent.match(/webkit/i),s=function(e,n){var r=t[e]=t[e]||[];r.push(n)},o=e.ark={store:function(e,t,n){typeof e=="function"&&(n=t,t=e,e=r()),!n&&t.call?(i&&s(e,t),t()):s(e,t)},load:function(n){var r=[];if(n){var i=n.split(/[ ,]/);for(var s=0,o=i.length;s<o;++s){var u=t[i[s]];if(!u)continue;for(var a=0,f=u.length;a<f;++a){var l=u[a];l.call&&(l="("+l+")()"),r.push("<script>"+l+"</script>")}}}else for(var c in t)r.push(e.ark.load(c));return r.join("\n")},dustSection:function(e,t,n,r){var i=o.load(r&&r.name);return e.write(i)}}})(Mobify),Mobify.ark.store("jquery",function(){window.Mobify=window.Mobify||{},function(e){String.prototype.trim===e&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===e&&(Array.prototype.reduce=function(t){if(this===void 0||this===null)throw new TypeError;var n=Object(this),r=n.length>>>0,i=0,s;if(typeof t!="function")throw new TypeError;if(r==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)s=arguments[1];else do{if(i in n){s=n[i++];break}if(++i>=r)throw new TypeError}while(!0);while(i<r)i in n&&(s=t.call(e,s,n[i],i,n)),i++;return s})}();var Zepto=function(){function k(e){return S.call(e)=="[object Function]"}function L(e){return e instanceof Object}function A(e){return L(e)&&e.__proto__==Object.prototype}function O(e){return e instanceof Array}function M(e){return typeof e.length=="number"}function _(t){return t.filter(function(t){return t!==e&&t!==null})}function D(e){return e.length>0?n.fn.concat.apply([],e):e}function P(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function H(e){return e in a?a[e]:a[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function B(e,t){return typeof t=="number"&&!l[P(e)]?t+"px":t}function j(e){var t,n;return u[e]||(t=o.createElement(e),o.body.appendChild(t),n=f(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),n=="none"&&(n="block"),u[e]=n),u[e]}function F(t,r){return r===e?n(t):n(t).filter(r)}function I(e,t,n,r){return k(t)?t.call(e,n,r):t}function q(e,t,r){var i=e%2?t:t.parentNode;i?i.insertBefore(r,e?e==1?i.firstChild:e==2?t:null:t.nextSibling):n(r).remove()}function R(e,t){t(e);for(var n in e.childNodes)R(e.childNodes[n],t)}var e,t,n,r,i=[],s=i.slice,o=window.document,u={},a={},f=o.defaultView.getComputedStyle,l={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},c=/^\s*<(\w+|!)[^>]*>/,h=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,p=[1,3,8,9,11],d=["after","prepend","before","append"],v=o.createElement("table"),m=o.createElement("tr"),g={tr:o.createElement("tbody"),tbody:v,thead:v,tfoot:v,td:m,th:m,"*":o.createElement("div")},y=/complete|loaded|interactive/,b=/^\.([\w-]+)$/,w=/^#([\w-]+)$/,E=/^[\w-]+$/,S={}.toString,x={},T,N,C=o.createElement("div");return x.matches=function(e,t){if(!e||e.nodeType!==1)return!1;var n=e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,s=!i;return s&&(i=C).appendChild(e),r=~x.qsa(i,t).indexOf(e),s&&C.removeChild(e),r},T=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},N=function(e){return e.filter(function(t,n){return e.indexOf(t)==n})},x.fragment=function(t,r){t.replace&&(t=t.replace(h,"<$1></$2>")),r===e&&(r=c.test(t)&&RegExp.$1),r in g||(r="*");var i=g[r];return i.innerHTML=""+t,n.each(s.call(i.childNodes),function(){i.removeChild(this)})},x.Z=function(e,t){return e=e||[],e.__proto__=arguments.callee.prototype,e.selector=t||"",e},x.isZ=function(e){return e instanceof x.Z},x.init=function(t,r){if(!t)return x.Z();if(k(t))return n(o).ready(t);if(x.isZ(t))return t;var i;if(O(t))i=_(t);else if(A(t))i=[n.extend({},t)],t=null;else if(p.indexOf(t.nodeType)>=0||t===window)i=[t],t=null;else if(c.test(t))i=x.fragment(t.trim(),RegExp.$1),t=null;else{if(r!==e)return n(r).find(t);i=x.qsa(o,t)}return x.Z(i,t)},n=function(e,t){return x.init(e,t)},n.extend=function(n){return s.call(arguments,1).forEach(function(r){for(t in r)r[t]!==e&&(n[t]=r[t])}),n},x.qsa=function(e,t){var n;return e===o&&w.test(t)?(n=e.getElementById(RegExp.$1))?[n]:i:e.nodeType!==1&&e.nodeType!==9?i:s.call(b.test(t)?e.getElementsByClassName(RegExp.$1):E.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t))},n.isFunction=k,n.isObject=L,n.isArray=O,n.isPlainObject=A,n.inArray=function(e,t,n){return i.indexOf.call(t,e,n)},n.trim=function(e){return e.trim()},n.uuid=0,n.map=function(e,t){var n,r=[],i,s;if(M(e))for(i=0;i<e.length;i++)n=t(e[i],i),n!=null&&r.push(n);else for(s in e)n=t(e[s],s),n!=null&&r.push(n);return D(r)},n.each=function(e,t){var n,r;if(M(e)){for(n=0;n<e.length;n++)if(t.call(e[n],n,e[n])===!1)return e}else for(r in e)if(t.call(e[r],r,e[r])===!1)return e;return e},n.fn={forEach:i.forEach,reduce:i.reduce,push:i.push,indexOf:i.indexOf,concat:i.concat,map:function(e){return n.map(this,function(t,n){return e.call(t,n,t)})},slice:function(){return n(s.apply(this,arguments))},ready:function(e){return y.test(o.readyState)?e(n):o.addEventListener("DOMContentLoaded",function(){e(n)},!1),this},get:function(t){return t===e?s.call(this):this[t]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(e){return this.forEach(function(t,n){e.call(t,n,t)}),this},filter:function(e){return k(e)?this.not(this.not(e)):n([].filter.call(this,function(t){return x.matches(t,e)}))},add:function(e,t){return n(N(this.concat(n(e,t))))},is:function(e){return this.length>0&&x.matches(this[0],e)},not:function(t){var r=[];if(k(t)&&t.call!==e)this.each(function(e){t.call(this,e)||r.push(this)});else{var i=typeof t=="string"?this.filter(t):M(t)&&k(t.item)?s.call(t):n(t);this.forEach(function(e){i.indexOf(e)<0&&r.push(e)})}return n(r)},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!L(e)?e:n(e)},last:function(){var e=this[this.length-1];return e&&!L(e)?e:n(e)},find:function(e){var t;return this.length==1?t=x.qsa(this[0],e):t=this.map(function(){return x.qsa(this,e)}),n(t)},closest:function(e,t){var r=this[0];while(r&&!x.matches(r,e))r=r!==t&&r!==o&&r.parentNode;return n(r)},parents:function(e){var t=[],r=this;while(r.length>0)r=n.map(r,function(e){if((e=e.parentNode)&&e!==o&&t.indexOf(e)<0)return t.push(e),e});return F(t,e)},parent:function(e){return F(N(this.pluck("parentNode")),e)},children:function(e){return F(this.map(function(){return s.call(this.children)}),e)},contents:function(){return n(this.map(function(){return s.call(this.childNodes)}))},siblings:function(e){return F(this.map(function(e,t){return s.call(t.parentNode.children).filter(function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return this.map(function(){return this[e]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),f(this,"").getPropertyValue("display")=="none"&&(this.style.display=j(this.nodeName))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return this.each(function(){n(this).wrapAll(n(e)[0].cloneNode(!1))})},wrapAll:function(e){return this[0]&&(n(this[0]).before(e=n(e)),e.append(this)),this},wrapInner:function(e){return this.each(function(){var t=n(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return n(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(t){return(t===e?this.css("display")!="none":!t)?this.hide():this.show()},prev:function(e){return n(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return n(this.pluck("nextElementSibling")).filter(e||"*")},html:function(t){return t===e?this.length>0?this[0].innerHTML:null:this.each(function(e){var r=this.innerHTML;n(this).empty().append(I(this,t,e,r))})},text:function(t){return t===e?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(n,r){var i;return typeof n=="string"&&r===e?this.length==0||this[0].nodeType!==1?e:n=="value"&&this[0].nodeName=="INPUT"?this.val():!(i=this[0].getAttribute(n))&&n in this[0]?this[0][n]:i:this.each(function(e){if(this.nodeType!==1)return;if(L(n))for(t in n)this.setAttribute(t,n[t]);else this.setAttribute(n,I(this,r,e,this.getAttribute(n)))})},removeAttr:function(e){return this.each(function(){this.nodeType===1&&this.removeAttribute(e)})},prop:function(t,n){return n===e?this[0]?this[0][t]:e:this.each(function(e){this[t]=I(this,n,e,this[t])})},data:function(t,n){var r=this.attr("data-"+P(t),n);return r!==null?r:e},val:function(t){return t===e?this.length>0?this[0].multiple?n(this[0]).find("option").filter(function(e){return this.selected}).pluck("value"):this[0].value:e:this.each(function(e){this.value=I(this,t,e,this.value)})},offset:function(){if(this.length==0)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:e.width,height:e.height}},css:function(n,r){if(r===e&&typeof n=="string")return this.length==0?e:this[0].style[T(n)]||f(this[0],"").getPropertyValue(n);var i="";for(t in n)typeof n[t]=="string"&&n[t]==""?this.each(function(){this.style.removeProperty(P(t))}):i+=P(t)+":"+B(t,n[t])+";";return typeof n=="string"&&(r==""?this.each(function(){this.style.removeProperty(P(n))}):i=P(n)+":"+B(n,r)),this.each(function(){this.style.cssText+=";"+i})},index:function(e){return e?this.indexOf(n(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return this.length<1?!1:H(e).test(this[0].className)},addClass:function(e){return this.each(function(t){r=[];var i=this.className,s=I(this,e,t,i);s.split(/\s+/g).forEach(function(e){n(this).hasClass(e)||r.push(e)},this),r.length&&(this.className+=(i?" ":"")+r.join(" "))})},removeClass:function(t){return this.each(function(n){if(t===e)return this.className="";r=this.className,I(this,t,n,r).split(/\s+/g).forEach(function(e){r=r.replace(H(e)," ")}),this.className=r.trim()})},toggleClass:function(t,r){return this.each(function(i){var s=I(this,t,i,this.className);(r===e?!n(this).hasClass(s):!!r)?n(this).addClass(s):n(this).removeClass(s)})}},["width","height"].forEach(function(t){n.fn[t]=function(r){var i,s=t.replace(/./,function(e){return e[0].toUpperCase()});return r===e?this[0]==window?window["inner"+s]:this[0]==o?o.documentElement["offset"+s]:(i=this.offset())&&i[t]:this.each(function(e){var i=n(this);i.css(t,I(this,r,e,i[t]()))})}}),d.forEach(function(e,t){n.fn[e]=function(){var e=n.map(arguments,function(e){return L(e)?e:x.fragment(e)});if(e.length<1)return this;var r=this.length,i=r>1,s=t<2;return this.each(function(n,o){for(var u=0;u<e.length;u++){var a=e[s?e.length-u-1:u];R(a,function(e){e.nodeName!=null&&e.nodeName.toUpperCase()==="SCRIPT"&&(!e.type||e.type==="text/javascript")&&window.eval.call(window,e.innerHTML)}),i&&n<r-1&&(a=a.cloneNode(!0)),q(t,o,a)}})},n.fn[t%2?e+"To":"insert"+(t?"Before":"After")]=function(t){return n(t)[e](this),this}}),x.Z.prototype=n.fn,x.camelize=T,x.uniq=N,n.zepto=x,n}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(e){function t(e){var t=this.os={},n=this.browser={},r=e.match(/WebKit\/([\d.]+)/),i=e.match(/(Android)\s+([\d.]+)/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),u=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),a=u&&e.match(/TouchPad/),f=e.match(/Kindle\/([\d.]+)/),l=e.match(/Silk\/([\d._]+)/),c=e.match(/(BlackBerry).*Version\/([\d.]+)/);if(n.webkit=!!r)n.version=r[1];i&&(t.android=!0,t.version=i[2]),o&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),u&&(t.webos=!0,t.version=u[2]),a&&(t.touchpad=!0),c&&(t.blackberry=!0,t.version=c[2]),f&&(t.kindle=!0,t.version=f[1]),l&&(n.silk=!0,n.version=l[1]),!l&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0)}t.call(e,navigator.userAgent),e.__detect=t}(Zepto),function(e){function s(e){return e._zid||(e._zid=r++)}function o(e,t,r,i){t=u(t);if(t.ns)var o=a(t.ns);return(n[s(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||o.test(e.ns))&&(!r||s(e.fn)===s(r))&&(!i||e.sel==i)})}function u(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function a(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function f(t,n,r){e.isObject(t)?e.each(t,r):t.split(/\s/).forEach(function(e){r(e,n)})}function l(t,r,i,o,a,l){l=!!l;var c=s(t),h=n[c]||(n[c]=[]);f(r,i,function(n,r){var i=a&&a(r,n),s=i||r,f=function(e){var n=s.apply(t,[e].concat(e.data));return n===!1&&e.preventDefault(),n},c=e.extend(u(n),{fn:r,proxy:f,sel:o,del:i,i:h.length});h.push(c),t.addEventListener(c.e,f,l)})}function c(e,t,r,i){var u=s(e);f(t||"",r,function(t,r){o(e,t,r,i).forEach(function(t){delete n[u][t.i],e.removeEventListener(t.e,t.proxy,!1)})})}function v(t){var n=e.extend({originalEvent:t},t);return e.each(d,function(e,r){n[e]=function(){return this[r]=h,t[e].apply(t,arguments)},n[r]=p}),n}function m(e){if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var t=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0,t.call(this)}}}var t=e.zepto.qsa,n={},r=1,i={};i.click=i.mousedown=i.mouseup=i.mousemove="MouseEvents",e.event={add:l,remove:c},e.proxy=function(t,n){if(e.isFunction(t)){var r=function(){return t.apply(n,arguments)};return r._zid=s(t),r}if(typeof n=="string")return e.proxy(t[n],t);throw new TypeError("expected function")},e.fn.bind=function(e,t){return this.each(function(){l(this,e,t)})},e.fn.unbind=function(e,t){return this.each(function(){c(this,e,t)})},e.fn.one=function(e,t){return this.each(function(n,r){l(this,e,t,null,function(e,t){return function(){var n=e.apply(r,arguments);return c(r,t,e),n}})})};var h=function(){return!0},p=function(){return!1},d={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,n,r){var i=!1;if(n=="blur"||n=="focus")e.iswebkit?n=n=="blur"?"focusout":n=="focus"?"focusin":n:i=!0;return this.each(function(s,o){l(o,n,r,t,function(n){return function(r){var i,s=e(r.target).closest(t,o).get(0);if(s)return i=e.extend(v(r),{currentTarget:s,liveFired:o}),n.apply(s,[i].concat([].slice.call(arguments,1)))}},i)})},e.fn.undelegate=function(e,t,n){return this.each(function(){c(this,t,n,e)})},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,r){return n==undefined||e.isFunction(n)?this.bind(t,n||r):this.delegate(n,t,r)},e.fn.off=function(t,n,r){return n==undefined||e.isFunction(n)?this.unbind(t,n||r):this.undelegate(n,t,r)},e.fn.trigger=function(t,n){return typeof t=="string"&&(t=e.Event(t)),m(t),t.data=n,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(t)})},e.fn.triggerHandler=function(t,n){var r,i;return this.each(function(s,u){r=v(typeof t=="string"?e.Event(t):t),r.data=n,r.target=u,e.each(o(u,t.type||t),function(e,t){i=t.proxy(r);if(r.isImmediatePropagationStopped())return!1})}),i},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return this.bind(t,e)}}),["focus","blur"].forEach(function(t){e.fn[t]=function(e){if(e)this.bind(t,e);else if(this.length)try{this.get(0)[t]()}catch(n){}return this}}),e.Event=function(e,t){var n=document.createEvent(i[e]||"Events"),r=!0;if(t)for(var s in t)s=="bubbles"?r=!!t[s]:n[s]=t[s];return n.initEvent(e,r,!0,null,null,null,null,null,null,null,null,null,null,null,null),n}}(Zepto),function(e,t){function c(e){return e.toLowerCase()}function h(e){return r?r+e:c(e)}var n="",r,i,s,o={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},u=window.document,a=u.createElement("div"),f=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,l={};e.each(o,function(e,i){if(a.style[e+"TransitionProperty"]!==t)return n="-"+c(e)+"-",r=i,!1}),l[n+"transition-property"]=l[n+"transition-duration"]=l[n+"transition-timing-function"]=l[n+"animation-name"]=l[n+"animation-duration"]="",e.fx={off:r===t&&a.style.transitionProperty===t,cssPrefix:n,transitionEnd:h("TransitionEnd"),animationEnd:h("AnimationEnd")},e.fn.animate=function(t,n,r,i){return e.isObject(n)&&(r=n.easing,i=n.complete,n=n.duration),n&&(n/=1e3),this.anim(t,n,r,i)},e.fn.anim=function(r,i,s,o){var u,a={},c,h=this,p,d=e.fx.transitionEnd;i===t&&(i=.4),e.fx.off&&(i=0);if(typeof r=="string")a[n+"animation-name"]=r,a[n+"animation-duration"]=i+"s",d=e.fx.animationEnd;else{for(c in r)f.test(c)?(u||(u=[]),u.push(c+"("+r[c]+")")):a[c]=r[c];u&&(a[n+"transform"]=u.join(" ")),!e.fx.off&&typeof r=="object"&&(a[n+"transition-property"]=Object.keys(r).join(", "),a[n+"transition-duration"]=i+"s",a[n+"transition-timing-function"]=s||"linear")}return p=function(t){if(typeof t!="undefined"){if(t.target!==t.currentTarget)return;e(t.target).unbind(d,arguments.callee)}e(this).css(l),o&&o.call(this)},i>0&&this.bind(d,p),setTimeout(function(){h.css(a),i<=0&&setTimeout(function(){h.each(function(){p.call(this)})},0)},0),this},a=null}(Zepto),function($){function triggerAndReturn(e,t,n){var r=$.Event(t);return $(e).trigger(r,n),!r.defaultPrevented}function triggerGlobal(e,t,n,r){if(e.global)return triggerAndReturn(t||document,n,r)}function ajaxStart(e){e.global&&$.active++===0&&triggerGlobal(e,null,"ajaxStart")}function ajaxStop(e){e.global&&!--$.active&&triggerGlobal(e,null,"ajaxStop")}function ajaxBeforeSend(e,t){var n=t.context;if(t.beforeSend.call(n,e,t)===!1||triggerGlobal(t,n,"ajaxBeforeSend",[e,t])===!1)return!1;triggerGlobal(t,n,"ajaxSend",[e,t])}function ajaxSuccess(e,t,n){var r=n.context,i="success";n.success.call(r,e,i,t),triggerGlobal(n,r,"ajaxSuccess",[t,n,e]),ajaxComplete(i,t,n)}function ajaxError(e,t,n,r){var i=r.context;r.error.call(i,n,t,e),triggerGlobal(r,i,"ajaxError",[n,r,e]),ajaxComplete(t,n,r)}function ajaxComplete(e,t,n){var r=n.context;n.complete.call(r,t,e),triggerGlobal(n,r,"ajaxComplete",[t,n]),ajaxStop(n)}function empty(){}function mimeToDataType(e){return e&&(e==htmlType?"html":e==jsonType?"json":scriptTypeRE.test(e)?"script":xmlTypeRE.test(e)&&"xml")||"text"}function appendQuery(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function serializeData(e){isObject(e.data)&&(e.data=$.param(e.data)),e.data&&(!e.type||e.type.toUpperCase()=="GET")&&(e.url=appendQuery(e.url,e.data))}function serialize(e,t,n,r){var i=$.isArray(t);$.each(t,function(t,s){r&&(t=n?r:r+"["+(i?"":t)+"]"),!r&&i?e.add(s.name,s.value):(n?$.isArray(s):isObject(s))?serialize(e,s,n,t):e.add(t,s)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(e){var t="jsonp"+ ++jsonpID,n=document.createElement("script"),r=function(){$(n).remove(),t in window&&(window[t]=empty),ajaxComplete("abort",i,e)},i={abort:r},s;return e.error&&(n.onerror=function(){i.abort(),e.error()}),window[t]=function(r){clearTimeout(s),$(n).remove(),delete window[t],ajaxSuccess(r,i,e)},serializeData(e),n.src=e.url.replace(/=\?/,"="+t),$("head").append(n),e.timeout>0&&(s=setTimeout(function(){i.abort(),ajaxComplete("timeout",i,e)},e.timeout)),i},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(e,t){return $.ajax({url:e,success:t})},$.post=function(e,t,n,r){return $.isFunction(t)&&(r=r||n,n=t,t=null),$.ajax({type:"POST",url:e,data:t,success:n,dataType:r})},$.getJSON=function(e,t){return $.ajax({url:e,success:t,dataType:"json"})},$.fn.load=function(e,t){if(!this.length)return this;var n=this,r=e.split(/\s/),i;return r.length>1&&(e=r[0],i=r[1]),$.get(e,function(e){n.html(i?$(document.createElement("div")).html(e.replace(rscript,"")).find(i).html():e),t&&t.call(n)}),this};var escape=encodeURIComponent;$.param=function(e,t){var n=[];return n.add=function(e,t){this.push(escape(e)+"="+escape(t))},serialize(n,e,t),n.join("&").replace("%20","+")}}(Zepto),function(e){e.fn.serializeArray=function(){var t=[],n;return e(Array.prototype.slice.call(this.get(0).elements)).each(function(){n=e(this);var r=n.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&r!="submit"&&r!="reset"&&r!="button"&&(r!="radio"&&r!="checkbox"||this.checked)&&t.push({name:n.attr("name"),value:n.val()})}),t},e.fn.serialize=function(){var e=[];return this.serializeArray().forEach(function(t){e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e.join("&")},e.fn.submit=function(t){if(t)this.bind("submit",t);else if(this.length){var n=e.Event("submit");this.eq(0).trigger(n),n.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(e){function i(t){return t=e(t),(!!t.width()||!!t.height())&&t.css("display")!=="none"}function u(e,t){var n,r,i=e.match(o);if(i&&i[2]in s){var n=s[i[2]],r=i[3];e=i[1];if(r){var u=Number(r);isNaN(u)?r=r.replace(/^["']|["']$/g,""):r=u}}return t(e,n,r)}var t=e.zepto,n=t.qsa,r=t.matches,s=t.cssFilters={visible:function(){if(i(this))return this},hidden:function(){if(!i(this))return this},selected:function(){if(this.selected)return this},checked:function(){if(this.checked)return this},parent:function(){return this.parentNode},first:function(e){if(e===0)return this},last:function(e,t){if(e===t.length-1)return this},eq:function(e,t,n){if(e===n)return this},contains:function(t,n,r){if(e(this).text().indexOf(r)>-1)return this},has:function(e,n,r){if(t.qsa(this,r).length)return this}},o=new RegExp("(.*):(\\w+)(?:\\(([^)]+)\\))?$\\s*");t.qsa=function(r,i){return u(i,function(s,o,u){try{!s&&o&&(s="*");var a=n(r,s)}catch(f){throw console.error("error performing selector: %o",i),f}return o?t.uniq(e.map(a,function(e,t){return o.call(e,t,a,u)})):a})},t.matches=function(e,t){return u(t,function(t,n,i){return(!t||r(e,t))&&(!n||n.call(e,null,i)===e)})}}(Zepto),function(e){e.fn.end=function(){return this.prevObject||e()},e.fn.andSelf=function(){return this.add(this.prevObject||e())},"filter,add,not,eq,first,last,find,closest,parents,parent,children,siblings".split(",").forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=n.apply(this,arguments);return e.prevObject=this,e}})}(Zepto),function(){var e=[],t=window.Zepto;if(!t||e.__proto__)return;var n=function(n){return e.push.apply(this,n),this};t.zepto.Z=function(e,t){e=e||[];var r=new n(e);return r.selector=t||"",r},t.zepto.Z.prototype=n.prototype=t.fn,t.fn.concat=function(){var e=[];return e.push.apply(e,this),t.each(arguments,function(t,n){typeof n=="object"&&typeof n.length=="number"?e.push.apply(e,n):e.push(n)}),e},t.fn.empty=function(){return this.each(function(e,t){while(t.firstChild)t.removeChild(t.firstChild)})};var r=/^\s*<(\w+)[^>]*>/,i=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,s={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],"*":[0,"",""]};s.optgroup=s.option,s.tbody=s.tfoot=s.colgroup=s.caption=s.thead,s.th=s.td,t.zepto.fragment=function(t,n){n===undefined&&(n=r.test(t)&&RegExp.$1),t=t.toString().replace(i,"<$1></$2>");var o=s[n]||s["*"],u=o[0],a=document.createElement("div");a.innerHTML=o[1]+t+o[2];while(u--)a=a.lastChild;return e.slice.call(a.childNodes)}}(),$.noConflict?Mobify.$=$.noConflict(!0):(Mobify.$=window.Zepto,Mobify.$.support=Mobify.$.support||{},Zepto===$&&delete window.$,delete window.Zepto)},!1),Mobify.ark.store("lib",'(function(e,t,n,r){function m(t,r){function S(e,t){var n=b+e*-1;x(n,t)}function x(e,t){e<0&&(e=0),e>=y&&(e=y-1);if(t||e!=b){if(!t){l.trigger("indexchange",[e,b]);if(c.focus){var r=n(c.focus).offset();r&&n("body").animate({scrollTop:r.top},250)}var i=g.slice(0,e+1+c.lazyLookahead).find("img[lazysrc]");i.each(function(e,t){this.setAttribute("src",this.getAttribute("lazysrc")),this.removeAttribute("lazysrc")})}b=e;var s=g.eq(b),o=g.eq(0),u=s.offset().left,a=o.offset().left,f=s.width(),p=o.width(),v=parseInt(o.parent().css("marginLeft"))||0;w=-(u-a-(f-p)*(v/p))}h[d]=c.duration,E()}function O(e){s.touch||e.preventDefault(),T=!0,N=!1,C=o(e),k=0,L=0,A=!1,h[d]="0s"}function M(e){if(!T||N)return;var t=o(e);k=C.x-t.x,L=C.y-t.y;if(A||i(k)>i(L)&&i(k)>c.minDragDelta){A=!0,e.preventDefault();if(b==0&&k<0||b==y-1&&k>0)k*=.4;E(w-k)}else i(L)>i(k)&&i(L)>c.minDragDelta&&(N=!0)}function _(e){T=!1;var t=i(k),n=0;t>i(L)&&t>c.minMoveDelta&&(n=t>g.eq(b).width()?2:1,n*=k>0?-1:1),S(n)}function D(e){A&&e.preventDefault()}function P(){T&&_()}function H(){setTimeout(function(){S(0,!0)},1)}var l=n(t);if(l.data("slide"))return;l.data("slide",!0);var c=n.extend({},m.defaults,r),h=l[0].style,g=l.children(),y=g.length,b=0,w=0,E=v?function(e){t.style[p]=a+(e||w)+f}:function(e){h.left=(e||w)+"px"};E();var T=!1,N=!1,C,k,L,A;n(e).bind("orientationchange.slide",H),l.bind(u.down+".slide",O).bind(u.move+".slide",M).bind(u.up+".slide",_).bind("click.slide",D).bind("slidemove.slide",function(e,t){S(t)}).bind("indexchange.slide",function(e,t,r){n(c.dots).children().removeClass(c.dotsClass).eq(t).addClass(c.dotsClass)}).trigger("indexchange",[b,b]),s.touch||l.bind("mouseout.slide",P),y<=c.maxDots&&n(c.dots).addClass("on").children().bind("touchstart.slide mouseup.slide",function(e){e.type=="touchstart"&&e.preventDefault(),x(n(this).index())})}function g(t,r){var i=n.extend({},m.defaults,r),s=n(t);s.unbind(".slide").data("slide",!1),n(e).unbind(".slide"),n(i.dots).unbind(".slide")}n.extend(n.support,{touch:"ontouchend"in t,transitions3d:!!(e.WebKitCSSMatrix&&"m11"in new WebKitCSSMatrix)});var i=Math.abs,s=n.support,o=s.touch?function(e){return e=e.originalEvent||e,{x:e.touches[0].clientX,y:e.touches[0].clientY}}:function(e){return{x:e.clientX,y:e.clientY}},u=s.touch?{down:"touchstart",move:"touchmove",up:"touchend"}:{down:"mousedown",move:"mousemove",up:"mouseup"};n.support.events=u;var a="translate"+(s.transitions3d?"3d(":"("),f=s.transitions3d?"px,0,0)":"px,0)",l=["Webkit","Moz","O","ms",""],c=t.createElement("div").style,h=function(e){for(var t=0;t<l.length;++t)if(c[l[t]+e]!==r)return l[t]+e},p=h("Transform"),d=h("TransitionDuration"),v=!!p;m.defaults={minDragDelta:10,minMoveDelta:20,dots:".x-slide-dots",dotsClass:"x-current",maxDots:12,duration:"0.5s",lazyLookahead:1},n.fn.slide=function(e){return this.each(function(){m(this,e)})},n.fn.unslide=function(e){return this.each(function(){g(this,e)})},t.addEventListener("DOMContentLoaded",function y(){t.removeEventListener("DOMContentLoaded",y,!1),n(".x-slide-items").slide()},!1)})(window,document,Mobify.$)',!0),function(){var e=location.hash,t=/mobify-path=([^&;]+)/g.exec(e);if(t){var n=t[1];/mobify-all/.test(e)?document.cookie="mobify-path="+n+"; path=/":(document.cookie="mobify-path=1; path=/",sessionStorage["mobify-path"]=n)}}(),function(e,t){var n=e.console=window.console;n.group||(n.group=n.log,n.groupEnd=function(){}),t.extend(n,{die:function(){var t=[].slice.call(arguments);throw n.group("(T_T) Fatal error (T_T)"),n.error.apply(n,t),n.groupEnd(),e.config.isDebug||e.unmobify(),t},logGroup:function(e,r,i){var s=!0;t.each(i,function(t,i){s&&n.group(r),typeof t=="number"?n[e].apply(window,i):n[e](t,i),s=!1}),s||n.groupEnd()}})}(Mobify,Mobify.$),function(e,t){t.desktop=function(e){document.cookie="mobify-path; path=/;",e?location=e:location.reload()},t.i18n=function(e,t){e.push("DEFAULT");var n=function(n){for(var r=0;r<e.length;r++){var i=t[e[r]][n];if(i)return i}};return n}}(Mobify.$,Mobify),function(e,t){function r(e){return(" "+ +e+"ms ").slice(-10)}function i(e,t,n){var i=e[0],s=e[1],o=r(i-n[0][0]),u=r(i-(n[t-1]||n[0])[0]);return o+u+s}var n=t.console,s=t.timing={points:[],selectors:[],addPoint:function(e,t){var n=t||+(new Date);return this.points.push([n,e]),n},addSelector:function(e,t){var n=t||+(new Date);this.selectors.push([n,e])},logGroup:function(t,r){var s=t.map(i);n.groupCollapsed?n.groupCollapsed(r):n.group(r),n.dir?n.dir(s):e.each(s,function(e,t){n.log(t)}),n.groupEnd()},logPoints:function(){this.logGroup(this.points,"Global timing"),this.logGroup(this.selectors,"Data evaluation timing")},reset:function(){this.points=[],this.selectors=[]}};s.addPoint("Finished Document",t.points[1]),s.addPoint("Loaded Mobify.js")}(Mobify.$,Mobify),function(e,t){function p(e,t,n){return t=t.toLowerCase(),result="<"+t+(s[t]||"")+n.replace(f[t]," x-$1")+">"}var n=function(t){return e.map(t,function(e,t){return t})},r=function(t){return e.map(t,function(e,t){return e})},i=new RegExp("(<script[\\s\\S]*?>)","gi"),s={style:' media="mobify-media"',script:' type="text/mobify-script"'},o=new RegExp(r(s).join("|"),"g"),u={img:["src"],iframe:["src"],script:["src","type"],link:["href"],style:["media"]},a=new RegExp("<("+n(u).join("|")+")([\\s\\S]*?)>","gi"),f={},l={},c,h=t.html=t.html||{};e.each(u,function(t,n){e.each(n,function(e,t){l[t]=!0}),t==="img"&&(n=n.concat("width","height")),f[t]=new RegExp("\\s+((?:"+n.join("|")+")\\s*=\\s*(?:'([\\s\\S])+?'|\"([\\s\\S])+?\"))","gi")}),c=new RegExp("\\sx-("+n(l).join("|")+")","gi"),e.extend(h,{disable:function(e){var t=/(<!--[\s\S]*?-->)|(?=<\/script)/i,n=e.split(t),r=n.map(function(e){var t;return e?/^<!--/.test(e)?e:(t=e.split(i),t[0]=t[0].replace(a,p),t[1]&&(t[1]=t[1].replace(a,p)),t):""});return[].concat.apply([],r).join("")},enable:function(e){return e.replace(c," $1").replace(o,"")}})}(Mobify.$,Mobify),function(e,t){var n=function(e){return e.nodeName.toLowerCase()},r=function(e){return e.replace('"',"&quot;")},i=function(e){if(!e)return"";e.length&&(e=e[0]);var t=[];return[].forEach.call(e.attributes,function(e){t.push(" ",e.name,'="',r(e.value),'"')}),"<"+n(e)+t.join("")+">"},s=function(e){return e?(e.length&&(e=e[0]),"</"+n(e)+">"):""},o=function(e){var t=e.doctype||[].filter.call(e.childNodes,function(e){return e.nodeType==Node.DOCUMENT_TYPE_NODE})[0];return t?"<!DOCTYPE HTML"+(t.publicId?' PUBLIC "'+t.publicId+'"':"")+(t.systemId?' "'+t.systemId+'"':"")+">":""},u=function(e){return e?[].map.call(e.childNodes,function(e){var t=n(e);return t=="#comment"?"<!--"+e.textContent+"-->":t=="plaintext"?e.textContent:t=="script"&&(/mobify\./.test(e.src)||/Mobify/.test(e.textContent))?"":e.outerHTML||e.nodeValue}).join(""):""},a,f=function(t){if(a)return a;var t=t||e,n=t.getElementsByTagName("head")[0]||t.createElement("head"),r=t.getElementsByTagName("body")[0]||t.createElement("body"),s=t.getElementsByTagName("html")[0];return a={doctype:o(t),htmlTag:i(s),headTag:i(n),bodyTag:i(r),headContent:u(n),bodyContent:u(r)},a.all=function(){return this.doctype+this.htmlTag+this.headTag+this.headContent+this.bodyContent},a},l=t.unmobify=function(t){t=t||e,/complete|loaded/.test(t.readyState)?c(t):t.addEventListener("DOMContentLoaded",c,!1)},c=function(t){t=t&&t.target||t||e,t.removeEventListener("DOMContentLoaded",c,!1);var n=f(t);setTimeout(function(){t.open(),t.write(n.all()),t.close()},15)},h=t.html||{};t.$?t.$.extend(h,{extractHTML:f,extractHTMLFromElement:u,openTag:i,closeTag:s}):(t.api=1,l())}(document,Mobify),function(e,t){var n=function(t){var n=/<!--(?:[\s\S]*?)-->|(<\/head\s*>|<body[\s\S]*$)/gi;t=e.extend({},t);var r=t.bodyContent=t.headContent+t.bodyContent;t.headContent="";for(var i;i=n.exec(r);i){if(!i[1])continue;if(i[1][1]!="/"){t.headContent=t.head||r.slice(0,i.index),t.bodyContent=i[0];var s=/^((?:[^>'"]*|'[^']*?'|"[^"]*?")*>)([\s\S]*)$/.exec(i[0]);s&&(t.bodyTag=s[1],t.bodyContent=s[2]);break}t.headContent=r.slice(0,i.index),t.bodyContent=r.slice(i.index+i[1].length)}return t},r=function(t){var n=t.match(/^<(\w+)([\s\S]*)/i),r=document.createElement(n[1]);return e.each(e("<div"+n[2])[0].attributes,function(e,t){r.setAttribute(t.nodeName,t.nodeValue)}),e(r)},i=t.html||{};e.extend(i,{extractDOM:function(){var e=n(i.extractHTML());t.timing.addPoint("Recovered Markup");var s=this.disable(e.headContent),o=this.disable(e.bodyContent);t.timing.addPoint("Disabled Markup");var u={doctype:e.doctype};return u.$head=r(e.headTag).append(s),u.$body=r(e.bodyTag).append(o),u.$html=r(e.htmlTag).append(u.$head,u.$body),t.timing.addPoint("Built Passive DOM"),u}})}(Mobify.$,Mobify);var dust={};(function(dust){function Context(e,t,n){this.stack=e,this.global=t,this.blocks=n}function Stack(e,t,n,r){this.tail=t,this.isObject=!dust.isArray(e)&&e&&typeof e=="object",this.head=e,this.index=n,this.of=r}function Stub(e){this.head=new Chunk(this),this.callback=e,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(e,t,n){this.root=e,this.next=t,this.data="",this.flushable=!1,this.taps=n}function Tap(e,t){this.head=e,this.tail=t}dust.cache={},dust.register=function(e,t){if(!e)return;dust.cache[e]=t},dust.render=function(e,t,n){var r=(new Stub(n)).head;dust.load(e,r,Context.wrap(t)).end()},dust.stream=function(e,t){var n=new Stream;return dust.nextTick(function(){dust.load(e,n.head,Context.wrap(t)).end()}),n},dust.renderSource=function(e,t,n){return dust.compileFn(e)(t,n)},dust.compileFn=function(e,t){var n=dust.loadSource(dust.compile(e,t));return function(e,t){var r=t?new Stub(t):new Stream;return dust.nextTick(function(){n(r.head,Context.wrap(e)).end()}),r}},dust.load=function(e,t,n){var r=dust.cache[e];return r?r(t,n):dust.onLoad?t.map(function(t){dust.onLoad(e,function(r,i){if(r)return t.setError(r);dust.cache[e]||dust.loadSource(dust.compile(i,e)),dust.cache[e](t,n).end()})}):t.setError(new Error("Template Not Found: "+e))},dust.loadSource=function(source,path){return eval(source)},Array.isArray?dust.isArray=Array.isArray:dust.isArray=function(e){return Object.prototype.toString.call(e)=="[object Array]"},dust.nextTick=function(e){setTimeout(e,0)},dust.isEmpty=function(e){return dust.isArray(e)&&!e.length?!0:e===0?!1:!e},dust.filter=function(e,t,n){if(n)for(var r=0,i=n.length;r<i;r++){var s=n[r];s==="s"?t=null:e=dust.filters[s](e)}return t&&(e=dust.filters[t](e)),e},dust.filters={h:function(e){return dust.escapeHtml(e)},j:function(e){return dust.escapeJs(e)},u:encodeURI,uc:encodeURIComponent},dust.makeBase=function(e){return new Context(new Stack,e)},Context.wrap=function(e){return e instanceof Context?e:new Context(new Stack(e))},Context.prototype.get=function(e){var t=this.stack,n;while(t){if(t.isObject){n=t.head[e];if(n!==undefined)return n}t=t.tail}return this.global?this.global[e]:undefined},Context.prototype.getPath=function(e,t){var n=this.stack,r=t.length;if(e&&r===0)return n.head;if(!n.isObject)return undefined;n=n.head;var i=0;while(n&&i<r)n=n[t[i]],i++;return n},Context.prototype.push=function(e,t,n){return new Context(new Stack(e,this.stack,t,n),this.global,this.blocks)},Context.prototype.rebase=function(e){return new Context(new Stack(e),this.global,this.blocks)},Context.prototype.current=function(){return this.stack.head},Context.prototype.getBlock=function(e){var t=this.blocks;if(!t)return;var n=t.length,r;while(n--){r=t[n][e];if(r)return r}},Context.prototype.shiftBlocks=function(e){var t=this.blocks;return e?(t?newBlocks=t.concat([e]):newBlocks=[e],new Context(this.stack,this.global,newBlocks)):this},Stub.prototype.flush=function(){var e=this.head;while(e){if(!e.flushable){if(e.error){this.callback(e.error),this.flush=function(){};return}return}this.out+=e.data,e=e.next,this.head=e}this.callback(null,this.out)},Stream.prototype.flush=function(){var e=this.head;while(e){if(!e.flushable){if(e.error){this.emit("error",e.error),this.flush=function(){};return}return}this.emit("data",e.data),e=e.next,this.head=e}this.emit("end")},Stream.prototype.emit=function(e,t){var n=this.events;n&&n[e]&&n[e](t)},Stream.prototype.on=function(e,t){return this.events||(this.events={}),this.events[e]=t,this},Chunk.prototype.write=function(e){var t=this.taps;return t&&(e=t.go(e)),this.data+=e,this},Chunk.prototype.end=function(e){return e&&this.write(e),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(e){var t=new Chunk(this.root,this.next,this.taps),n=new Chunk(this.root,t,this.taps);return this.next=n,this.flushable=!0,e(n),t},Chunk.prototype.tap=function(e){var t=this.taps;return t?this.taps=t.push(e):this.taps=new Tap(e),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(e,t){return e(this,t)},Chunk.prototype.reference=function(e,t,n,r){if(typeof e=="function"){e=e(this,t,null,{auto:n,filters:r});if(e instanceof Chunk)return e}return dust.isEmpty(e)?this:this.write(dust.filter(e,n,r))},Chunk.prototype.section=function(e,t,n,r){if(typeof e=="function"){e=e(this,t,n,r);if(e instanceof Chunk)return e}var i=n.block,s=n["else"];r&&(t=t.push(r));if(dust.isArray(e)){if(i){var o=e.length,u=this;for(var a=0;a<o;a++)u=i(u,t.push(e[a],a,o));return u}}else if(e===!0){if(i)return i(this,t)}else if(e||e===0){if(i)return i(this,t.push(e))}else if(s)return s(this,t);return this},Chunk.prototype.exists=function(e,t,n){var r=n.block,i=n["else"];if(!dust.isEmpty(e)){if(r)return r(this,t)}else if(i)return i(this,t);return this},Chunk.prototype.notexists=function(e,t,n){var r=n.block,i=n["else"];if(dust.isEmpty(e)){if(r)return r(this,t)}else if(i)return i(this,t);return this},Chunk.prototype.block=function(e,t,n){var r=n.block;return e&&(r=e),r?r(this,t):this},Chunk.prototype.partial=function(e,t){return typeof e=="function"?this.capture(e,t,function(e,n){dust.load(e,n,t).end()}):dust.load(e,this,t)},Chunk.prototype.helper=function(e,t,n,r){return dust.helpers[e](this,t,n,r)},Chunk.prototype.capture=function(e,t,n){return this.map(function(r){var i=new Stub(function(e,t){e?r.setError(e):n(t,r)});e(i.head,t).end()})},Chunk.prototype.setError=function(e){return this.error=e,this.root.flush(),this},dust.helpers={sep:function(e,t,n){return t.stack.index===t.stack.of-1?e:n.block(e,t)},idx:function(e,t,n){return n.block(e,t.push(t.stack.index))}},Tap.prototype.push=function(e){return new Tap(e,this)},Tap.prototype.go=function(e){var t=this;while(t)e=t.head(e),t=t.tail;return e};var HCHARS=new RegExp(/[&<>\"]/),AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g;dust.escapeHtml=function(e){return typeof e=="string"?HCHARS.test(e)?e.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;"):e:e};var BS=/\\/g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;dust.escapeJs=function(e){return typeof e=="string"?e.replace(BS,"\\\\").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):e}})(dust),function(e){var t=Mobify.console,n=function(e,t,n){var r=this.root,i=r.warnings=r.warnings||{},s=r.overwrites=r.overwrites||{},o=n===null||n===undefined||n===""||typeof n.length!="undefined"&&!n.length||n instanceof Error||!n&&this.get("laziness")>0;t&&e.importance>-1&&(o?i[t.crumbs]=n:delete i[t.crumbs],t.value!==undefined&&!t.value._async&&(s[t.crumbs]=n))},r=function(e){this.tail||(t.logGroup("warn","Unfilled values",this.warnings),t.logGroup("warn","Missing -> Wrappers",this.forgotten),t.logGroup("log","Overwrites",this.overwrites),t.logGroup("log","Choices",this.choices),t.group("All extracted data"),t.log(e),t.groupEnd())},i=function(t,n){var r=function(e){var t=arguments;return e.map(function(e){var n=function(n){return t[3]==="exists"?e.exists(n,t[1],t[2]).end():t[3]==="notexists"?e.notexists(n,t[1],t[2]).end():t[2]===null?e.reference(n,t[1],t[3].auto,t[3].filters).end():e.section(n,t[1],t[2],t[3]).end()};i.push(n)})},i=[],s,o;return r.onresult=function(e){o?e.call(r,s):i.push(e)},r.finish=function(t){s=t,o=!0,e.each(i,function(e,n){n.call(r,t)})},r._async=!0,n.call(t.env().head,t,r),o?s:r},s=function(t){var n=function(n,i,s){return t=t||Mobify.conf.data&&Mobify.conf.data.$html,(e.fn.init||e.zepto.init).call(this,n,i||r.context(),s)},r=e.sub(n);return r.context=function(){return t||(Mobify.conf.data?Mobify.conf.data.$html:"<div>")},r.zepto||(r.fn.init=n,r.fn.init.prototype=e.fn),r};e.sub=e.sub||function(t){return e.extend(t,e),t.zepto=e.extend({},e.zepto),t},e.fn.anchor=function(){return s(this)},Mobify.data2={gatherEmpties:n,makeCont:function(t){var i=new Mobify.data2.cont(e.extend({},{laziness:-1},t));return Mobify.config.isDebug&&i.on("assignReference",n).on("complete",r),i},Async:i,M:{$:s(),async:i}}}(Mobify.$),function(e,t){var n=t.data2.stack=function(e,t,n,r){this.tail=t,this.head=e,this.index=n,this.len=r},r=/^[^!?.]*(\.[^!?.]+)*$/i;n.prototype={_mobifyStack:!0,extend:function(e,t,r){return new n(e,this,t,r)},crumbs:function(){var e=[];for(var t=this;t.tail;t=t.tail)t.index!==undefined&&e.unshift(t.index);return e.toString=function(){return this.join(".")},e},get:function(e){var t=this;while(!(e in t.head)&&t.tail)t=t.tail;return t.head&&t.head[e]},set:function(e,t){return this.head[e]=t},ref:function(t,n){var i=(t||"").toString().match(r),s=this,o,u,a,f;if(!i)return;o=i[0].split("."),u=o[0];if(u&&(isNaN(u)||!e.isArray(s.head)))while(!(u in s.head)&&s.tail)s=s.tail;!(u in s.head)&&n&&(s=this),a=s.crumbs(),a.pop(),a.push.apply(a,o),f=s.head;var l=f,c=0;while((tok=o[c++])!==undefined)tok==""?l=f:(f=l,u=tok,l=f?f[tok]:undefined);if(f&&u in f||n)return{target:f,value:l,key:u,crumbs:a}}}}(Mobify.$,Mobify),function(e,t,n){var r=/^([?!]?)(.*)$/,i=window.Location,s=t.data2.stack,o=t.data2.Async,u=t.data2.cont=function(e,t,n,r,i){s.call(this,e,t,n,r);if(!t){var o=this.root=this;this.handlers={},this.pending=0}else this.root=t.root;var u=t&&t.env();i?this.env(u.extend(i,n,r)):u||this.env(new s(i||{}))};e.extend(u,{importance:{"!":1,"?":-1,"":0},decodeAssignment:function(e){return parse=e.toString().match(r),{importance:this.importance[parse[1]],selector:parse[2]}}}),u.prototype=e.extend(new s,{extend:function(e,t,n,r){return new u(e,this,t,n,r)},env:function(e){return e!==n?this.set("env",e):this.get("env")},source:function(e){return e!==n?this.set("source",e):this.get("source")},all:function(){var e;for(e=this.env();e.tail.tail;e=e.tail);return e.head},blankTarget:function(){var t=this.source();if(e.isArray(t))return[];if(e.isPlainObject(t))return{}},_eval:function(e){var t=this.root,n=this.extend({source:e},this.index,this.length),r=n.eval();return r},eval:function(e){if(e!==n)return this._eval(e);var t=this.blankTarget(),r=t?this.evalCollection(t):this.evalLeaf(),i=this.root;return!this.parent&&this===i&&(i.pending?i.incomplete||(i.incomplete=!0,this.on("assignReference",function(){i.pending||i.emit("complete",[this.all(),this])})):i.emit("complete",[r,this])),r},evalLeaf:function(){var t=this.source();try{return t?e.isFunction(t)&&!t._async?t.call(this.env().head,this):t:t}catch(n){return n}},evalCollection:function(t){var n=this.source(),r=n.length,i=this;return e.each(n,function(e,n){if(n&&(n.jquery||n.nodeType)&&typeof e=="string"&&e.indexOf("$")){var s=i.root,o=s.forgotten=s.forgotten||[];o.push([e,n])}i.extend({source:n},e,r,t).evalReference()}),t},evalReference:function(){var e,n,r=this,i=u.decodeAssignment(this.index);if(i.importance>=this.get("laziness")){this.ref=e=this.env().ref(i.selector,!0);if(!e){t.console.warn(i.selector," has a syntax error or points to object that does not exist");return}n=this.eval();if(n&&n._async){e.value=n,e.target&&e.key&&(e.target[e.key]=n);var s=r.root;n.onresult(function(t){s.pending-=1,r.assignReference(i,e,t)}),s.pending+=1}else this.assignReference(i,e,n);return n}return},assignReference:function(e,n,r){return r instanceof Error||(n.target&&n.key?n.target[n.key]=r:this.tail&&(r=new Error(e.selector+" value can't be saved to "+n.crumbs))),this.emit("assignReference",[e,n,r]),t.config.isDebug&&t.timing.addSelector(n.crumbs),r},choose:function(){var e=this,n=e.root,r=n.forgotten=n.forgotten||[],i=arguments,s=n.choices=n.choices||{},o=([].some.call(i,function(r,i){var s=new t.data2.cont({source:r,laziness:1});s.root=s,s.env(e.env().extend({})),s.on("assignReference",t.data2.gatherEmpties).eval(),[].push.apply(n.forgotten,s.forgotten||[]);for(var u in s.warnings)break;return u||(o=r),!u}),o),u=e.extend({source:o},e.index,e.of);if(o)return s[e.ref.crumbs]=u.eval()},map:function(t,n){var r=t.length,i=this,s;return s=e.map(t,function(t,s){var o=i.extend({source:n},s,r,{$:t.tagName&&e(t).anchor(),KEY:s,LEN:r,THIS:t});return o.eval()}),s},ajax:function(n,r){return o(this,function(i,s){e.ajax(i.eval(n)).success(function(n,o,u){if(!r)s.finish(n);else if(typeof n!="string")i.env(i.env().extend({THIS:n})),s.finish(i.eval(r));else{var a=e(t.html.disable(n));i.env(i.env().extend({THIS:a,$:a.anchor()})),s.finish(i.eval(r))}}).error(function(){s.finish(null)})})},tmpl:function(e,n){var r=arguments;return e instanceof Array&&(e=e[0]),o(this,function(i,s){var o=dust.makeBase({lib_import:t.ark.dustSection});r.length==1&&(n=i.all()),dust.render(e,o.push(n),function(e,n){e?(s.finish(n),t.console.die(e)):s.finish(n)})})},data:function(e,t){var r=t===n,i=this.env().ref(e);if(!i)return;return r?i.value:i.target[i.key]=t},on:function(e,t){var n=this.root.handlers,r=n[e]=n[e]||[];return r.push(t),this},emit:function(t,n){var r=this,i=this,s=this.root.handlers;e.each(s[t]||[],function(e,t){t.apply(i,n)})}})}(Mobify.$,Mobify),function(e,t){var n=t.data2&&t.data2.Async,r=dust.makeBase({}).constructor,i=dust.stream("",{}).head.constructor,s=i.prototype.exists,o=i.prototype.notexists,u=i.prototype.block;i.prototype.exists=function(e,t,n){if(typeof e=="function"){e=e(this,t,n,"exists");if(e instanceof i)return e}return s.call(this,e,t,n)},i.prototype.notexists=function(e,t,n){if(typeof e=="function"){e=e(this,t,n,"notexists");if(e instanceof i)return e}return o.call(this,e,t,n)},i.prototype.block=function(t,n,r){var i=t?t.shift():undefined;return i&&(n=new n.constructor(n.stack,e.extend(n.global||{},{_SUPER_:function(e,n,i){return e.block(t,n,r)}}),n.blocks)),u.call(this,i,n,r)};var a=function(t,r,i){while(t&&i<r.length){if(t._async){var s=n(e.noop);return t.onresult.push(function(e){s.result(a(e,r,i))}),s}t=t[r[i]],i++}return t};r.prototype.getAscendablePath=function(e,t){var n=this.stack;return e?this.getPath(e,t):n.isObject?(n=this.get(t[0]),a(n,t,1)):undefined},r.prototype.getBlock=function(t){var n=this.blocks;return n?(n=e.map(n,function(e){return e[t]}),n):[]};var f=function(e){return typeof e!="string"&&typeof e.length=="number"&&!e.tagName};e.extend(dust.filters,{h:function(t){return t?f(t)?e.map(t,dust.filters.h).join(""):typeof t.outerHTML!="undefined"?t.outerHTML:dust.escapeHtml(t):""},innerHTML:function(t){return t?f(t)?e.map(t,function(e){return e.innerHTML||e.nodeValue}).join(""):e(t).html():""},openTag:t.html.openTag,closeTag:t.html.closeTag});var l=function(e,t,n,r){return r?n.block(e,t):n["else"]?n["else"](e,t):e};e.extend(dust.helpers,{first:function(e,t,n){var r=t.stack.index===0;return l(e,t,n,r)},last:function(e,t,n){var r=t.stack.index===t.stack.of-1;return l(e,t,n,r)}});var c=dust.isArray;dust.isArray=function(e){return e&&e.appendTo||c(e)};var h=dust.load;dust.load=function(e,t,n){return e?h.apply(this,arguments):t}}(Mobify.$,Mobify),function(e,t){if(!window.enableStudioJS)return;var n=0,r=function(e){var t=/<![\s\S]*?>|[^<]+|<!--[\s\S]*?-->|(<script)([\s\S]*?<\/script>)|(<\w+)((?:[^>'"]*|'[^']*?'|"[^"]*?")*\/?>)/gi,n=e.replace(t,function(e,n,r,i,s){return i=i||n,s=s||r,i?i+' mobifyjsindex="src'+t++ +'"'+s:e});return n},i=function(e,t){var n=function(r){r.data.command==="html"&&r.data.dest==="page"&&r.data.key===e&&r.source===window&&(window.removeEventListener("message",n,!1),t(r.data.value,r.data.key))};window.addEventListener("message",n,!1)},s=function(e,t){window.postMessage({dest:"extension",command:"html",key:e,value:t},"*")},o=t.emitMarkup;t.emitMarkup=function(e){t.studioJS.get("renderHTML",function(e){o(e)}),t.studioJS.set("resultHTML",e)};var u=t.html.extractHTML;t.html.extractHTML=function(){var n=u(markup);return e.each(n,function(e,t){n[e]=r(t)}),t.studioJS.set("sourceHTML",n.all()),result}}(Mobify.$,Mobify),function(){var e=Mobify.config=Mobify.config||{},t=/mobify-path=([^&;]*)/g.exec(document.cookie);e.isDebug=t&&t[1]?1:0,e.configFile||(e.configFile=Mobify.$('script[src*="mobify.js"]').first().attr("src")||""),e.configDir=e.configFile.replace(/\/[^\/]*$/,"/")}(),Mobify.ark.store("enhance",function(){(function(e,t){var n=t.support.orientation="orientation"in e&&"onorientationchange"in e&&!/android/i.test(navigator.userAgent),r=function(){var e=document.documentElement;return(n?orientation%180:e.clientWidth>e.clientHeight)?"landscape":"portrait"},i,s,o=function(){clearTimeout(s);var n=document.documentElement.clientWidth;if(n==i)return s=setTimeout(o,250);i=n,t(e).trigger("orientationchange"),f()},u=r(),a=[],f=function(){var e=r(),t=u;if(e!=u){u=e;for(var n=0,i=a.length;n<i;++n)a[n](e,t)}},l=n?"orientationchange":"resize",c=n?f:o,h=function(){t(e).unbind(l,c).bind(l,c)};Mobify.orientation=function(e){if(!e)return r();h(),a.push(e)}})(this,Mobify.$),function(e,t,n){var r=n("<div>",{id:"mc-test"}),i=r[0].style,s="ontouchend"in t,o=/(ip(od|ad|hone)|android|nokia|blackberry|webos)/gi.exec(navigator.userAgent),u=o&&(o[2]?"ios":o[1].toLowerCase())||"desktop",a=/ipad|android(?!.*mobile)/i.test(navigator.userAgent),f=u!="desktop"&&!a,l=1,c=["screen and (-webkit-min-device-pixel-ratio:1.5)","screen and (-webkit-min-device-pixel-ratio:2)"];if("devicePixelRatio"in e)l=devicePixelRatio;else if(e.matchMedia)l=matchMedia(c[1]).matches&&2||matchMedia(c[0]).matches&&1.5;else{var h="<style>@media "+c[0]+"{#mc-test{color:red}}"+"@media "+c[1]+"{#mc-test{color:blue}}"+"</style>",p,d;r.hide().html(h).appendTo(t.documentElement),p=r.css("color"),r.remove();if(d=/255(\))?/gi.exec(p))l=d[1]&&2||1.5}var v=Mobify.config||{};v.os=u,v.tablet=a,v.smartphone=f,v.touch=s,v.orientation=Mobify.orientation(),l>1?(v.HD="@2x",v.pixelRatio=l):v.HD="",Mobify.enhance=function(){var e=[u,(s?"":"no")+"touch",Mobify.orientation()];l>1?e.push("hd"+(l+"").replace(/[^\w]/,""),"hd"):e.push("sd"),n("html").addClass("x-"+e.join(" x-")),Mobify.orientation(function(e,t){n("html").removeClass("x-"+t).addClass("x-"+e)})}}(this,document,Mobify.$)},!1),function(e,t,n){var r=n.timing,i=n.transform=n.transform||{};t.extend(n.transform,{prepareConf:function(e){var s=n.html.extractDOM();s.config=n.config;var o=n.conf=e.call(n.data2&&n.data2.M,s,i.acceptData);if(o&&o.data){r.addPoint("Setup Conf"),o.data=t.extend(s,o.data),n.evaluatedData=undefined;var u=n.data2.makeCont({source:s}).on("complete",i.acceptData);r.addPoint("Prepared conf for evaluation"),r.addSelector("Start"),u.eval()}},acceptData:function(e,t){n.evaluatedData||(n.evaluatedData=e,n.evaluatedCont=t,r.addPoint("Evaluated Conf"));var s=typeof e=="string"?e:e.OUTPUTHTML,o=n.html.enable(s||"");r.addPoint("Enabled Markup"),i.emitMarkup(o)},emitMarkup:function(t){r.addPoint("DOMContentLoaded");if(!t)return n.console.warn("Output HTML is empty, unmobifying."),n.unmobify();r.addPoint("Writing Document"),n.config.isDebug&&r.logPoints(),window.setTimeout(function(){e.open(),e.write(t),e.close()})},run:function(t){var r=function(){if(!/complete|loaded/.test(e.readyState))return setTimeout(r,15);n.transform.prepareConf(t)};r()}})}(document,Mobify.$,Mobify),Mobify.timing.addPoint("Walked Mobify.js"),function(e,t){var n=document.createElement("a"),r=["//ir0.mobify.com","//ir1.mobify.com","//ir2.mobify.com","//ir3.mobify.com"],i=Mobify.URLHash=function(e){var t,n=e.length;return t=e.charCodeAt(n-2%n)^e.charCodeAt(n-3%n)^e.charCodeAt(n-5%n)^e.charCodeAt(n-7%n)^e.charCodeAt(n-11%n)^e.charCodeAt(n-13%n)^e.charCodeAt(n-17%n)^e.charCodeAt(n-19%n),t=(t*1103515245%4294967296+12345)%4294967296,t=t<0?t+4294967296:t,t},s=Mobify.getImageURL=function(e,t){t=t||{};var n=r[i(e)%r.length],s=[n];return t.format&&s.push(t.format+(t.quality||"")),t.maxWidth&&(s.push(t.maxWidth),t.maxHeight&&s.push(t.maxHeight)),s.push(e),s.join("/")},o=t.fn.resizeImages=function(r){var i=t.extend(u,typeof r=="object"&&r),o=e.devicePixelRatio,a=this.filter(i.selector).add(this.find(i.selector)),f;return typeof r=="number"&&(i.maxWidth=r),o&&(i.maxWidth&&(i.maxWidth=Math.ceil(i.maxWidth*o)),i.maxHeight&&(i.maxHeight=Math.ceil(i.maxHeight*o))),a.each(function(){if(f=this.getAttribute(i.attribute))n.href=f,this.setAttribute("x-src",s(n.href,i))})},u=o.defaults={selector:"img[x-src]",attribute:"x-src"}}(this,Mobify.$),Mobify.transform.run(function(){var e=this.$,t=this;return{data:e.extend({"?unmobify":!1,mobileViewport:"width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=no;",touchIcon:undefined,formatDetection:["telephone=no","address=no"],cssDir:function(e){return e.data("config.configDir")},imageDir:function(e){return e.data("config.configDir")+"i/"},"?HD":function(e){return e.data("config.HD")},siteConfig:{},buildDate:1342549006746,configName:"",cssName:function(e){return e.data("configName").split("/").pop().split(".")[0]||"stylesheet"}},{OUTPUTHTML:function(e){var t,n,r;return t=e.data("$html"),t.find("iframe, img, script").remove(),n=document.createElement("script"),r=function(){location.search=location.search.replace(/([?&]iter=)(\d+)/,function(e,t,n){return t+ ++n}).replace(/([?&]perf=)([^&]*)/,function(e,t,n){return t+JSON.stringify(Mobify.timing.points)})},n.textContent="("+r+")()",e.data("$body")[0].appendChild(n),t.prop("outerHTML")}})}}),Mobify.api=[1,1]
View
9 test/integration/performance/03.beyondtherack-home/project.json
@@ -0,0 +1,9 @@
+{
+ "name": "test/03.beyondtherack-home",
+ "api": "1.1",
+ "build_directory": "bld",
+ "plugins": [],
+ "exclude": [
+ "*.tmpl"
+ ]
+}
View
23 test/integration/performance/03.beyondtherack-home/src/mobify.konf
@@ -0,0 +1,23 @@
+{>"/base/lib/base_konf.konf"/}
+{<tmpl}{/tmpl}
+{<data} {
+
+'OUTPUTHTML': function(context) {
+ var $html = context.data('$html');
+ $html.find('iframe, img, script').remove();
+
+ var endIteration = document.createElement('script');
+ var inject = function() {
+ location.search = location.search.replace( /([?&]iter=)(\d+)/, function(all, start, index) {
+ return start + ++index
+ }).replace(/([?&]perf=)([^&]*)/, function(all, start, value) {
+ return start + JSON.stringify(Mobify.timing.points);
+ });
+ }
+ endIteration.textContent = '(' + inject + ')()';
+ context.data('$body')[0].appendChild(endIteration);
+
+ return $html.prop('outerHTML')
+}
+
+} {/data}
View
10 test/integration/performance/03.beyondtherack-home/src/tmpl/404.tmpl
@@ -0,0 +1,10 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ {image}
+
+ {/content}
+
+{/body}
View
5 test/integration/performance/03.beyondtherack-home/src/tmpl/_categorynav.tmpl
@@ -0,0 +1,5 @@
+{#categorynav}
+
+ {nav}
+
+{/categorynav}
View
68 test/integration/performance/03.beyondtherack-home/src/tmpl/_footer.tmpl
@@ -0,0 +1,68 @@
+{#footer}
+ {^isCart}
+ {?isLoggedIn}
+
+ <div class="x-backtotop">
+ <a id="x-backtotop-link" href="#"><span>Back to Top</span></a>
+ </div>
+
+ <nav class="x-category-nav">
+ {>_categorynav/}
+ </nav>
+
+ {?isCart}
+
+ {:else}
+
+ <div class="x-row">
+ <div class="x-account">
+ {account}
+ </div>
+ <div class="x-cart">
+ <a href="/bag/show">
+ {?checkoutButtonNum}
+ <span class="x-checkout-num">
+ {checkoutButtonNum}
+ </span>
+ {/checkoutButtonNum}
+ </a>
+ </div>
+ </div>
+
+ {/isCart}
+
+ {/isLoggedIn}
+
+ <nav id="x-bottom-nav">
+ <ul>
+ {#footerLinks}
+ <li>
+ {.}
+ </li>
+ {/footerLinks}
+ {?isLoggedIn}
+ <li>{signOut}</li>
+ {/isLoggedIn}
+ </ul>
+ </nav>
+ {/isCart}
+
+ <div class="x-row">
+ <!-- <div id="x-full-site"><a onclick="return Mobify.desktop();">View full site</a></div> -->
+ <div id="x-copyright">{?isLoggedIn}{copyright}{:else}{content.copyright}{/isLoggedIn}</div>
+ </div>
+
+ {shoppingbag}
+ {%script}
+ (function($) {
+ // Scroll to top.
+ $('#x-backtotop-link').bind('click', function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+ $('body').animate({scrollTop: 1}, 200);
+ return false;
+ });
+ })(Mobify.$);
+ {/script}
+
+{/footer}
View
86 test/integration/performance/03.beyondtherack-home/src/tmpl/_header.tmpl
@@ -0,0 +1,86 @@
+{#header}
+ <ul id="x-header-bar">
+ <li class="x-logo">
+ <a href="/">
+ <img src="{config.configDir}i/logo{HD}.png" alt="Beyond the Rack" />
+ </a>
+ </li>
+
+ {?isLoggedIn}
+
+ {?isCart}
+ {?content.checkout}
+
+ <li class="x-icon x-modify">
+ <a href="/bag/show">Modify cart</a>
+ </li>
+
+ {:else}
+
+ <li class="x-icon x-checkout">
+ <a href="/bag/checkout">Checkout now</a>
+ </li>
+
+ {/content.checkout}
+
+ {:else}
+
+ <li class="x-icon x-nav">
+ <a href="#">Nav</a>
+ </li>
+
+ <li class="x-icon x-account {?isAccountPage}x-active{/isAccountPage}">
+ {account}
+ </li>
+ <li class="x-icon x-cart">
+ <a href="/bag/show">
+ {?checkoutButtonNum}
+ <span class="x-checkout-num">
+ {checkoutButtonNum}
+ </span>
+ {/checkoutButtonNum}
+ </a>
+ </li>
+
+ {/isCart}
+
+ {:else}
+
+ {?content.login}
+
+ <li class="x-icon x-signup">
+ <a href="/auth/register?r=">Sign up here</a>
+ </li>
+
+ {/content.login}
+
+ {?content.register}
+
+ <li class="x-icon x-signup">
+ <a href="/auth/login?r=">Sign in here</a>
+ </li>
+
+ {/content.register}
+
+ {/isLoggedIn}
+ </ul>
+ {?isLoggedIn}
+ <nav id="x-top-nav" class="x-category-nav">
+ {>_categorynav/}
+ </nav>
+ {/isLoggedIn}
+
+ {%script}
+ (function($) {
+ // Toggle menu
+
+ $('li.x-nav a').click(function() {
+ $('body').toggleClass('x-nav-active').addClass('x-animate');
+ $('li.x-nav').toggleClass('x-active');
+ //$('#x-top-nav').slideToggle();
+ $('#x-top-nav').toggleClass('x-active');
+ return false;
+ });
+ })(Mobify.$);
+ {/script}
+{/header}
View
23 test/integration/performance/03.beyondtherack-home/src/tmpl/_record_sale_js.tmpl
@@ -0,0 +1,23 @@
+{%script}
+ /* GA order tracking */
+ (function($) {
+ var text = $('pre').text()
+ , orderId = /order no. ([0-9]+)/.exec(text)[1]
+ , taxRe = /[GQ]ST.*?\$\s*([0-9]+\.[0-9]+)/g
+ , matchTotal = /Total.*\$\s*([0-9]+\.[0-9]+)/.exec(text)
+ , tax = 0
+ , total = 0
+ , match;
+
+ while (match = taxRe.exec(text)) {
+ tax += +match[1] || 0;
+ }
+
+ if (matchTotal) total = matchTotal[1];
+
+ Mobify.analytics = Mobify.analytics || {};
+ Mobify.analytics.ga = Mobify.analytics.ga || [];
+ Mobify.analytics.ga.push(['_addTrans', orderId, 'BTR', total, tax], ['_trackTrans']);
+
+ })(Mobify.$);
+{/script}
View
24 test/integration/performance/03.beyondtherack-home/src/tmpl/accountinfo.tmpl
@@ -0,0 +1,24 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ <div id="x-context-nav" class="x-category-nav">
+
+ {accountMenu}
+
+ </div>
+
+ {?errorHeader}
+ <div id="x-error">
+ {errorHeader}
+ </div>
+ {/errorHeader}
+
+ {messageFlash}
+
+ {accountInfoForm}
+
+ {/content}
+
+{/body}
View
42 test/integration/performance/03.beyondtherack-home/src/tmpl/base.tmpl
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+{$html|openTag|s}
+{$head|openTag|s}
+ {+head}
+ {#lib_import/}
+ {%script}
+ Mobify.enhance();
+ // Scroll the page past URL bar if user did not scroll manually, and hash is absent.
+ Mobify.$(this).bind('load', function() {
+ location.hash || setTimeout(function() {
+ pageYOffset || scrollTo(0, 1);
+ }, 250);
+ });
+ {/script}
+ {$head|innerHTML|s}
+ <link rel="stylesheet" href="{config.configDir}{?config.tablet}tablet{:else}stylesheet{/config.tablet}.css" />
+ <script src="{config.configDir}a.js#m=1&amp;t={templateName}" async="true"></script>
+ {/head}
+</head>
+{$body|openTag|s}
+ {%script}
+ Mobify.$('body').last().addClass("{#templateName}x-{.}{~s}{/templateName}");
+ {/script}
+ {+header}
+ {>_header/}
+ {/header}
+ <div id="x-main">
+ {+body}
+ {$body|innerHTML|s}
+ {/body}
+ </div>
+ {+footer}
+ {>_footer/}
+ {/footer}
+ {+scripts}
+ {%script}
+
+ {/script}
+ {/scripts}
+</body>
+
+</html>
View
14 test/integration/performance/03.beyondtherack-home/src/tmpl/base_smartphone.tmpl
@@ -0,0 +1,14 @@
+{>base/}
+
+{<head}
+ {_SUPER_}
+ <meta name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=no;" />
+{/head}
+
+{<header}
+ <header id="x-header">{>_header/}</header>
+{/header}
+
+{<footer}
+ <footer id="x-footer">{>_footer/}</footer>
+{/footer}
View
47 test/integration/performance/03.beyondtherack-home/src/tmpl/base_tablet.tmpl
@@ -0,0 +1,47 @@
+{>base/}
+
+{<header}{/header}
+
+{<footer}{/footer}
+
+{+scripts}
+ {?content.orderConfirmed}
+ {>_record_sale_js/}
+ {/content.orderConfirmed}
+
+ {%script}
+ (function($) {
+ if ($('#bgdiv').length > 0) {
+ $('#body').addClass('x-home');
+ }
+
+ if(/(iPhone|iPod|iPad)/i.test(navigator.userAgent)) {
+ if (/OS [5]_.* like Mac OS X/i.test(navigator.userAgent)) {
+ Mobify.$('html').addClass('x-ios5');
+ }
+ }
+ })(Mobify.$);
+
+ $(document).ready(function() {
+ if (!$('html').hasClass('x-ios5')) {
+ // Add to Bag
+ var floatBagCount = floatBag.getTotalCount(); // save the current bag number
+ var _floatBagAdd = floatBag.add; // save the add functionality
+
+ floatBag.add = function() {
+ floatBagCount = floatBag.getTotalCount(); // get current bag number
+ _floatBagAdd.apply(this, arguments); // perform the normal add functionality
+ };
+
+ var _updateCheckoutButton = updateCheckoutButton;
+ updateCheckoutButton = function() {
+ if (floatBag.getTotalCount() > floatBagCount) {
+ window.scrollTo(0, document.body.scrollHeight); // if the new bag count is higher than before, the add was successful, scroll to the bottom
+ }
+ _updateCheckoutButton.apply(this, arguments);
+ };
+ }
+
+ });
+ {/script}
+{/scripts}
View
90 test/integration/performance/03.beyondtherack-home/src/tmpl/cart.tmpl
@@ -0,0 +1,90 @@
+{>base_smartphone/}
+
+{<body}
+
+ {#content}
+
+ {?checkout}
+ {%script}
+ Mobify.$('body').last().addClass('x-checkout');
+ {/script}
+ {:else}
+ <div id="x-context-nav">
+ <a href="#" onclick="history.back();return false" class="x-back">Back</a>
+
+ {subtotal}
+
+ </div>
+
+ {noItems}
+
+ <form action="{formAction}" method="post" id="x-cart-form">
+
+ {#items}
+
+ <div class="x-item">
+
+ {img}
+
+ <div class="x-desc">
+
+ {name}
+
+ {qtyLeft}
+
+ {?color}
+ <div class="x-color">
+ <span>{colorLabel}</span>
+ {color}
+ </div>
+ {/color}
+
+ {?size}
+ <div class="x-size">
+ <span>{sizeLabel}</span>
+ {size}
+ </div>
+ {/size}
+
+ {?qty}
+ <div class="x-qty">
+ <label>{qtyLabel}</label>
+ {qty}
+ </div>
+ {/qty}
+
+ {?price}
+ <div class="x-price">
+ <span>{priceLabel}</span>
+ {price}
+ </div>
+ {/price}
+
+ {expires}
+
+ {error}
+
+ {remove}
+
+ </div>
+
+ </div>
+
+ <hr>
+
+ {/items}
+
+ {subtotal}
+
+ {totalSaved}
+
+ {checkoutButton}
+
+ </form>
+ {/checkout}
+
+ {checkout}
+
+ {/content}
+ {script}
+{/body}
View
15 test/integration/performance/03.beyondtherack-home/src/tmpl/contact.tmpl
@@ -0,0 +1,15 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ <div id="x-context-nav" class="x-category-nav">
+
+ {helpMenu}
+
+ </div>
+
+ {contactForm}
+
+ {/content}
+{/body}
View
9 test/integration/performance/03.beyondtherack-home/src/tmpl/default.tmpl
@@ -0,0 +1,9 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ {content}
+
+ {/content}
+{/body}
View
95 test/integration/performance/03.beyondtherack-home/src/tmpl/events.tmpl
@@ -0,0 +1,95 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+ {marketingBanners}
+ <div id="x-currentevents">
+ {#currentEvents}
+ <div class="x-event">
+ <a href="{href}">
+ <img src="{src}" class="{class}" data-original="{original}" />
+ {text}
+ </a>
+ </div>
+ {/currentEvents}
+ </div>
+
+ {?endingEvents}
+ <div id="x-endingevents">
+ <h3>
+ Events Ending Soon
+ </h3>
+
+ {#endingEvents}
+ <div class="x-event">
+ <div>
+ {?href}
+ <a href="{href}">
+ {/href}
+ {text}
+ <span class="time">{time}</span>
+ {?href}
+ </a>
+ {/href}
+ </div>
+ </div>
+ {/endingEvents}
+
+ {?showMoreEnding}
+ <a class="toggle button">See all events ending soon</a>
+ {/showMoreEnding}
+ </div>
+ {/endingEvents}
+
+ {?upcomingEvents}
+ <div id="x-upcomingevents">
+ <h3>
+ Upcoming Events
+ </h3>
+
+ {#upcomingEvents}
+ <div class="x-event">
+ <div>
+ {?href}
+ <a href="{href}">
+ {/href}
+ {text}
+ <span class="time">{time}</span>
+ {?href}
+ </a>
+ {/href}
+ </div>
+ </div>
+ {/upcomingEvents}
+
+ {?showMoreUpcoming}
+ <a class="toggle button">See all upcoming events</a>
+ {/showMoreUpcoming}
+ </div>
+ {/upcomingEvents}
+ {jQuery}
+ {/content}
+ {%script}
+
+ (function($) {
+ // Drop Events Menu by default on Events pages
+ $('body').addClass('x-nav-active');
+ $('#x-header-bar .x-nav, #x-top-nav').addClass('x-active');
+
+ $(document).ready(function() {
+ setTimeout(function() {
+ $('img.x-lazy').each(function() {
+ var $img = $(this);
+
+ $img.attr('src', $img.attr('data-original'));
+ });
+ }, 1000);
+ });
+
+ // Toggle Events.
+ $('a.toggle').click(function() {
+ $(this).parent().toggleClass('x-expanded');
+ });
+ })(Mobify.$);
+ {/script}
+{/body}
View
15 test/integration/performance/03.beyondtherack-home/src/tmpl/faq.tmpl
@@ -0,0 +1,15 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ <div id="x-context-nav" class="x-category-nav">
+
+ {helpMenu}
+
+ </div>
+
+ {faq}
+
+ {/content}
+{/body}
View
5 test/integration/performance/03.beyondtherack-home/src/tmpl/forgotPassword.tmpl
@@ -0,0 +1,5 @@
+{>base_smartphone/}
+
+{<header}{/header}
+
+{<footer}{/footer}
View
16 test/integration/performance/03.beyondtherack-home/src/tmpl/inviteafriend.tmpl
@@ -0,0 +1,16 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ {successMessage}
+
+ {heroImg}
+
+ {inviteForm}
+
+ {inviteHistory}
+
+ {/content}
+ {script}
+{/body}
View
38 test/integration/performance/03.beyondtherack-home/src/tmpl/landing.tmpl
@@ -0,0 +1,38 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+ {image}
+ {?errors}
+ {errors}
+ {:else}
+ <h1 id="x-hero-text">
+ {text}
+ </h1>
+ {/errors}
+ {login}
+ {fbRoot}
+ {popup}
+ {/content}
+ {script}
+ {%script}
+ (function($) {
+ $(document).ready(function() {
+ $('#popup-container').before($('<div id="popup-overlay">'));
+
+ $('.popup-link').bind('click', function() {
+ // scroll to top
+ $('body').animate({scrollTop: 1});
+
+ // activate lightbox overlay
+ $('#popup-overlay').addClass('active');
+ });
+
+ $('#popup-close').bind('click', function() {
+ // hide the lightbox overlay
+ $('#popup-overlay').removeClass('active');
+ });
+ });
+ })(Mobify.$);
+ {/script}
+{/body}
View
8 test/integration/performance/03.beyondtherack-home/src/tmpl/orderConfirmation.tmpl
@@ -0,0 +1,8 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+ {content}
+ {/content}
+ {>_record_sale_js/}
+{/body}
View
272 test/integration/performance/03.beyondtherack-home/src/tmpl/pdp.tmpl
@@ -0,0 +1,272 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ <div id="x-context-nav">
+
+ <div id="x-event-details">
+ <a href="{eventLink}">
+ <div class="x-title">
+ {eventTitle}
+ </div>
+ <div class="x-timer">
+ {?eventTimer}
+ <span class="x-ends">
+ Ends in
+ </span>
+ {eventTimer}
+ {:else}
+ <span class="x-ends">
+ Event has Ended
+ </span>
+ {/eventTimer}
+ </div>
+ </a>
+ </div>
+
+ <ul id="x-product-nav">
+ {#productNav}
+ <li>
+ {.}
+ </li>
+ {/productNav}
+ </ul>
+
+ </div>
+
+ <div id="x-product">
+
+ <div class="x-slideshow-outer">
+ <div class="x-slideshow-items">
+ {sliderImages}
+ </div>
+ <span class="x-zoom-image"></span>
+ </div>
+
+ {productDetails}
+
+ </div>
+
+ <div id="x-accordion">
+
+ <div class="x-accordionitem x-additionalinfo x-active">
+
+ <h2><span>Additional Information</span></h2>
+
+ <div class="x-content">
+
+ {#additionalInfo}
+
+ {description}
+
+ {details}
+
+ {notes}
+
+ {guarantee}
+
+ {/additionalInfo}
+
+ </div>
+
+ </div>
+
+ <div class="x-accordionitem x-share">
+
+ <h2><span>Share your passion for fashion</span></h2>
+
+ <div class="x-content">
+
+ {shareLinks}
+
+ </div>
+
+ </div>
+
+ <div class="x-accordionitem x-help">
+
+ <h2><span>We're here to help</span></h2>
+
+ <div class="x-content">
+
+ {helpLinks}
+
+ </div>
+
+ </div>
+
+ <div class="x-accordionitem x-related">
+
+ <h2><span>You'll also love</span></h2>
+
+ <div class="x-content">
+
+ {relatedItems}
+
+ </div>
+
+ </div>
+
+ </div>
+
+ {/content}
+ {script}
+
+ {%script}
+ (function($) {
+ // Image Slider
+ var $slider = $('.x-slideshow-items').slide();
+
+ // center the slider
+ $(document).ready(function() {
+ setTimeout(function() {
+ if ($('#x-product .x-slideshow-items a').length > 2) {
+ $slider.trigger('slidemove', -1);
+ }
+ }, 300);
+ });
+
+
+ // close the lightbox when tapped
+ $('#lightbox-overlay, #lightbox').live('click', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ // get the slider index of the modal slider
+ var modal_slider_attr = document.querySelector('#lightbox .x-slideshow-items').style.webkitTransform.match(/[^()\s]+(?=,|\))/g);
+ var modal_slider_index = Math.abs(parseInt(modal_slider_attr[0], 10) / 240);
+
+ // get the slider index of the main slider
+ var main_slider_attr = document.querySelector('#x-product .x-slideshow-items').style.webkitTransform.match(/[^()\s]+(?=,|\))/g);
+ var main_slider_index = Math.abs(parseInt(main_slider_attr[0], 10) / 142);
+
+ var index_diff = Math.round(Math.abs(main_slider_index - modal_slider_index));
+ var direction = (main_slider_index - modal_slider_index > 0) ? 1 : -1;
+
+ // move the main slider to the same index as the modal slider
+ for (var i = 0; i < index_diff; i++) {
+ $slider.trigger('slidemove', direction);
+ }
+
+ $('#lightbox-overlay, #lightbox').remove();
+
+ // Affix body class for Android devices
+ if ($('html.x-android').length > 0) {
+ $('body').removeClass('x-modal-open');
+ }
+
+ return false;
+
+ });
+
+ function fixOverlay() {
+ if ($('html.x-android').length == 0) {
+ // make the overlay the height of the document
+ $('#lightbox-overlay').css('height', $(document).height());
+ }
+ }
+
+ // when the initial slider is tapped, open the slider in a modal
+ $('#x-product .x-slideshow-items a').bind('click', function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ window.scrollTo(0,1);
+
+ if ($('#lightbox').length > 0) {
+ // #lightbox exists, so just show the lightbox
+ $('#lightbox-overlay, #lightbox').show();
+
+ fixOverlay();
+ }
+ else {
+ // #lightbox doesn't exist, so create and show
+ var $lightbox = $('<div id="lightbox-overlay"></div><div id="lightbox"><div id="lightbox-wrapper" class="wrapper"></div><a id="lightbox-close"></a></div>');
+
+ $lightbox.find('#lightbox-wrapper').append($('.x-slideshow-outer').clone());
+ $('#x-product').before($lightbox);
+
+ fixOverlay();
+
+ // initialize modal slider
+ var $modal_slider = $('#lightbox .x-slideshow-items').removeAttr('data-slide').slide();
+
+ // get the slider index of the main slider
+ var slider_attr = document.querySelector('#x-product .x-slideshow-items').style.webkitTransform.match(/[^()\s]+(?=,|\))/g);
+ var slider_index = Math.abs(parseInt(slider_attr[0], 10) / 142);
+
+ // move the modal slider to the same index as the main slider
+ for (var i = 0; i < slider_index; i++) {
+ $modal_slider.trigger('slidemove', -1);
+ }
+
+ $('#lightbox .x-slideshow-items a').bind('click', function(e) {
+ e.preventDefault();
+ // don't let clicking image redirect to the image
+ });
+ }
+
+ // Affix body class for Android devices
+ if ($('html.x-android').length > 0) {
+ $('body').addClass('x-modal-open');
+ }
+ });
+
+ // Quantity Selector
+
+ $('.x-qtySelect').change(function() {
+
+ $('.quantity-dial input[type=text]').val($('.x-qtySelect option:selected').val());
+
+ });
+
+ // Accordion
+
+ // Account for already open items
+ $('.x-accordionitem.x-active .x-content').each(function() {
+ var $this = $(this);
+ height = $this.prop('scrollHeight');
+ $this.height(height);
+ });
+
+ $('.x-accordionitem h2').click(function() {
+
+ var $this = $(this);
+
+ $this.parent().toggleClass('x-active');
+
+ var height = $this.next().prop('scrollHeight');
+
+ // We can't CSS transition an unknown height, so get height
+ if ($this.parent().hasClass('x-active')) {
+ $this.next().height(height);
+ } else {
+ $this.next().height(0);
+ }
+
+ });
+
+ })(Mobify.$);
+
+ $(document).ready(function() {
+ // Add to Bag
+
+ var floatBagCount = floatBag.getTotalCount(); // save the current bag number
+ var _floatBagAdd = floatBag.add; // save the add functionality
+
+ floatBag.add = function() {
+ floatBagCount = floatBag.getTotalCount(); // get current bag number
+ _floatBagAdd.apply(this, arguments); // perform the normal add functionality
+ };
+
+ var _updateCheckoutButton = updateCheckoutButton;
+ updateCheckoutButton = function() {
+ if (floatBag.getTotalCount() > floatBagCount) {
+ window.location = '/bag/show'; // if the new bag count is higher than before, the add was successful, so forward to the bag page
+ }
+ _updateCheckoutButton.apply(this, arguments);
+ };
+ });
+
+ {/script}
+{/body}
View
145 test/integration/performance/03.beyondtherack-home/src/tmpl/productlist.tmpl
@@ -0,0 +1,145 @@
+{>base_smartphone/}
+
+{<body}
+ {%script}
+ (function($) {
+ $('body').addClass('x-grid');
+ })(Mobify.$);
+ {/script}
+ {#content}
+ <div id="x-context-nav">
+
+ <div id="x-event-details">
+ <a href="{backHref}">
+ <div class="x-title">
+ {eventTitle}
+ </div>
+ <div class="x-timer">
+ <span class="x-ends">
+ Ends in
+ </span>
+ {eventTimer}
+ </div>
+ </a>
+ </div>
+
+ <ul id="x-view-switcher">
+ <li class="x-icon x-grid">
+ <a href="#">Grid</a>
+ </li>
+ <li class="x-icon x-list">
+ <a href="#">List</a>
+ </li>
+ </ul>
+
+ </div>
+ <div id="x-filters">
+ {filterForm}
+ </div>
+
+ {?pagination}
+ <div class="x-pagination">
+ {pagination}
+ </div>
+ {/pagination}
+
+ <div id="x-product-list">
+ {productlist}
+ </div>
+
+ {?pagination}
+ <div class="x-pagination">
+ {pagination}
+ </div>
+ {/pagination}
+
+ {/content}
+ {script}
+ {%script}
+ //$("img.x-lazy").lazyload({ threshold : 800 });
+ (function($) {
+
+ $(document).ready(function() {
+ setTimeout(function() {
+ $('img.x-lazy').each(function() {
+ var $img = $(this);
+
+ $img.attr('src', $img.attr('data-original'));
+ });
+ }, 1000);
+ });
+
+ /* Filters */
+
+ $('#x-filters select').live('change', function(e) {
+ $('#x-filter-form').submit();
+ });
+
+ /* Toggle View */
+
+ $('li.x-grid a').parent().addClass('x-active');
+
+ $('li.x-grid a').click(function() {
+ $('body').removeClass('x-grid');
+ $('body').removeClass('x-list');
+ $('li.x-list a').parent().removeClass('x-active');
+ $('li.x-grid a').parent().removeClass('x-active');
+ $('body').addClass('x-grid');
+ $('li.x-grid a').parent().addClass('x-active');
+ return false;
+ });
+
+ $('li.x-list a').click(function() {
+ $('body').removeClass('x-grid');
+ $('body').removeClass('x-list');
+ $('li.x-list a').parent().removeClass('x-active');
+ $('li.x-grid a').parent().removeClass('x-active');
+ $('body').addClass('x-list');
+ $('li.x-list a').parent().addClass('x-active');
+ return false;
+ });
+
+ /* Ellipsis product titles that are too long */
+
+ $(document).ready(function() {
+ $('.x-title').each(function() {
+ var $this = $(this),
+ divh = $this.height() - 10,
+ p = $this.find('span').get(0),
+ prevHeight = 0;
+
+ if(p) {
+ /* Sanity check, make sure we are doing something each loop */
+ while (p.scrollHeight > divh && divh > 0) {
+ var text = p.textContent,
+ prevHeight = p.scrollHeight;
+
+ p.innerHTML = text.replace(/\W*\s(\S)*$/, '&hellip;');
+ }
+ }
+ });
+ });
+
+ })(Mobify.$);
+
+ $(document).ready(function() {
+ /* Add to Bag */
+
+ var floatBagCount = floatBag.getTotalCount();
+ var _floatBagAdd = floatBag.add;
+
+ floatBag.add = function() {
+ floatBagCount = floatBag.getTotalCount();
+ _floatBagAdd.apply(this, arguments);
+ };
+
+ var _updateCheckoutButton = updateCheckoutButton;
+ updateCheckoutButton = function() {
+ if (floatBag.getTotalCount() > floatBagCount) {
+ window.location = '/bag/show';
+ }
+ _updateCheckoutButton.apply(this, arguments);
+ };
+ });
+ {/script}
+{/body}
View
9 test/integration/performance/03.beyondtherack-home/src/tmpl/recommend.tmpl
@@ -0,0 +1,9 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ {recommend}
+
+ {/content}
+{/body}
View
29 test/integration/performance/03.beyondtherack-home/src/tmpl/register.tmpl
@@ -0,0 +1,29 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+ {image}
+ {?errors}
+ {errors}
+ {:else}
+ {?keywordHeader}
+ <h1 id="x-hero-text">
+ {keywordHeader}
+ </h1>
+ {/keywordHeader}
+ {?textHeader}
+ <p class="x-help-text">
+ {textHeader}
+ </p>
+ {/textHeader}
+ {?bullets}
+ <ul id="x-bullets">
+ {bullets}
+ </ul>
+ {/bullets}
+ {/errors}
+ {register}
+ {script}
+ {fbRoot}
+ {/content}
+{/body}
View
9 test/integration/performance/03.beyondtherack-home/src/tmpl/sizechart.tmpl
@@ -0,0 +1,9 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ {sizeChart}
+
+ {/content}
+{/body}
View
47 test/integration/performance/03.beyondtherack-home/src/tmpl/trackorders.tmpl
@@ -0,0 +1,47 @@
+{>base_smartphone/}
+
+{<body}
+ {#content}
+
+ <div id="x-context-nav" class="x-category-nav">
+
+ {accountMenu}
+
+ </div>
+
+ {orderList}
+
+ {/content}
+ {script}
+ {%script}
+ (function($){
+ // Account for already open items
+ $('.order-box.x-active .status-group').each(function() {
+ var $this = $(this);
+ height = $this.prop('scrollHeight');
+ $this.height(height);
+ });
+
+ $('.order-header').bind('click', function() {
+ var $this = $(this),
+ $parent = $this.parent('.order-box');
+ $orderstatus = $parent.find('.status-group');
+
+ $parent.toggleClass('x-active');
+
+ var height = $orderstatus.prop('scrollHeight');
+
+ // We can't CSS transition an unknown height, so get height
+ if ($parent.hasClass('x-active')) {
+ $orderstatus.height(height);
+ console.log('added height');
+ } else {
+ $orderstatus.height(0);
+ console.log('removed height');
+ }
+
+ });
+
+ })(Mobify.$);
+ {/script}
+{/body}
View
38 test/integration/run-tests.js
@@ -7,7 +7,6 @@ window.log = function(value) {
var tests = location.search.match(/(^\?|&)tests=([^&]*)/,'')[2].split('+')
, mode = location.search.match(/(^\?|&)mode=([^&]*)/,'')[2]
- , remainingTests = tests.slice()
, iframe = document.createElement('iframe')
, results = []
, advance;
@@ -34,40 +33,11 @@ iframe.addEventListener("load", function() {
}, false);
if (mode == 'performance') {
- var runTest = function() {
- if (!remainingTests.length) {
- var request = new XMLHttpRequest();
- request.open('POST', '/submit', true);
- request.send(results.join('\n'));
- return;
- }
-
- var testName = remainingTests.shift()
- , timingPoints = []
- , deferred
- , suite = new Benchmark.Suite();
-
- advance = function() {
- var MobifyObj = iframe.contentWindow.Mobify;
- MobifyObj && MobifyObj.timing && timingPoints.push(MobifyObj.timing.points);
-
- deferred
- ? (deferred.resolve(), deferred = undefined)
- : suite.run({async: true});
- };
- iframe.src = '/start/' + testName;
-
- suite.add(testName, { initCount: 1, minSamples: 250, defer: true, fn: function(defer) {
- deferred = defer;
- iframe.src = '/tag/' + mode + '/' + testName + '.html?' + +new Date;
- }}).on('cycle', function(event) {
- log(String(event.target));
- }).on('complete', function() {
- window.analyzeDeltas(timingPoints);
- runTest();
- })
+ var firstTest = tests.shift();
+ advance = function() {
+ window.location.href = '/tag/' + mode + '/' + firstTest + '.html?iter=0&perf=&tests=' + tests.join('+');
};
- runTest();
+ iframe.src = '/start/' + firstTest;
} else {
document.getElementById("qunit").style.display = "block";
tests.forEach(function(testName) {
Please sign in to comment.
Something went wrong with that request. Please try again.