/*! intel-appframework - v2.1.0 - 2014-03-24 */

(function(b){function n(){b.ui.isWin8=!0;b.os.ie&&b.ui.isSideMenuEnabled()&&b.ui.ready(function(){if(window.innerWidth>b.ui.handheldMinWidth)return!0;b.ui.slideSideMenu&&(b.ui.slideSideMenu=!1);b.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>");var m=b.query("#afui #navbar").find("a").not(".button");if(0<m.length){m.data("ignore-pressed","true").data("resetHistory","true");var f=parseFloat(100/m.length);m.css("width",f+"%")}var c=b.ui.updateNavbarElements;
b.ui.updateNavbarElements=function(){c.apply(b.ui,arguments);1!==b.query("#afui #navbar #metroMenu").length&&b.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>")};b.ui.isSideMenuOn=function(){var l=0>parseInt(b.getCssMatrix(b("#navbar")).f,10)?!0:!1;return this.isSideMenuEnabled()&&l};b.ui.toggleRightSideMenu=function(l,c,k){if(this.isAsideMenuEnabled()&&!this.togglingAsideMenu){var g=this,a=b("#menu"),e=b.query("#aside_menu"),h=b.query("#content,  #header, #navbar"),
q=b.query(".afui_panel_mask");k=k||this.transitionTime;var f="block"===b("#aside_menu").css("display"),m="-"+g.sideMenuWidth;0===q.length&&window.innerWidth<b.ui.handheldMinWidth&&(h.append("<div class='afui_panel_mask'></div>"),q=b.query(".afui_panel_mask"),b(".afui_panel_mask").bind("click",function(){b.ui.toggleSideMenu(!1,null,null,!0)}));var n=this.getSideMenuPosition();f&&0<n&&(f=!1);if(2===l||!f&&(void 0!==l&&!1!==l||void 0===l))this.togglingSideMenu=!0,e.show(),g.css3animate(h,{x:m,time:k,
complete:function(a){g.togglingSideMenu=!1;h.vendorCss("Transition","");c&&c(a);0!==q.length&&window.innerWidth<b.ui.handheldMinWidth&&q.show()}});else if(void 0===l||void 0!==l&&!1===l)this.togglingSideMenu=!0,g.css3animate(h,{x:"0px",time:k,complete:function(l){h.vendorCss("Transition","");h.vendorCss("Transform","");g.togglingSideMenu=!1;c&&c(l);b.ui.splitview||a.hide();e.hide();0!==q.length&&window.innerWidth<b.ui.handheldMinWidth&&q.hide()}})}};b.ui.toggleLeftSideMenu=function(c,d){if(this.isSideMenuEnabled()&&
!this.togglingSideMenu){this.togglingSideMenu=!0;var k=this,g=b.query("#menu"),a=b.query("#navbar"),e=this.isSideMenuOn();if(2===c||!e&&(void 0!==c&&!1!==c||void 0===c))g.show(),k.css3animate(a,{y:"-150px",time:b.ui.transitionTime,complete:function(){k.togglingSideMenu=!1;d&&d(!0)}}),k.css3animate(g,{y:"0px",time:b.ui.transitionTime});else if(void 0===c||void 0!==c&&!1===c)k.css3animate(a,{y:"0",time:b.ui.transitionTime,complete:function(){k.togglingSideMenu=!1;d&&d(!0);g.hide()}}),k.css3animate(g,
{y:"150px",time:b.ui.transitionTime})}}})}if(!b)throw"This plugin requires AFUi";b.ui?b.ui.ready(function(){n()}):b(document).ready(function(){n()})})(af);(function(b){b.fn.actionsheet=function(b){for(var f,c=0;c<this.length;c++)f=new n(this[c],b);return 1===this.length?f:this};var n=function(){var m=function(f,c){if(this.el="string"===typeof f||f instanceof String?document.getElementById(f):f){if(this instanceof m){if("object"===typeof c)for(var l in c)this[l]=c[l]}else return new m(f,c);var d=this,k;l=function(){};if("string"===typeof c)k=b("<div id='af_actionsheet'><div style='width:100%'>"+c+"<a href='javascript:;' class='cancel'>Cancel</a></div></div>");
else if("object"===typeof c){k=b("<div id='af_actionsheet'><div style='width:100%'></div></div>");var g=b(k.children().get(0));c.push({text:"Cancel",cssClasses:"cancel"});for(var a=0;a<c.length;a++){var e=b("<a href='javascript:;'>"+(c[a].text||"TEXT NOT ENTERED")+"</a>");e[0].onclick=c[a].handler||l;c[a].cssClasses&&0<c[a].cssClasses.length&&e.addClass(c[a].cssClasses);g.append(e)}}b(f).find("#af_actionsheet").remove();b(f).find("#af_action_mask").remove();b(f).append(k);k.vendorCss("Transition",
"all 0ms");k.cssTranslate("0,0");k.css("top",window.innerHeight+"px");this.el.style.overflow="hidden";k.on("click","a",function(){d.hideSheet();return!1});this.activeSheet=k;b(f).append("<div id='af_action_mask' style='position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:9998;background:rgba(0,0,0,.4)'/>");setTimeout(function(){k.vendorCss("Transition","all 300ms");k.cssTranslate("0,"+-k.height()+"px")},10);b("#af_action_mask").bind("touchstart touchmove touchend click",function(a){a.preventDefault();
a.stopPropagation()})}else window.alert("Could not find element for actionsheet "+f)};m.prototype={activeSheet:null,hideSheet:function(){var f=this;this.activeSheet.off("click","a",function(){f.hideSheet()});b(this.el).find("#af_action_mask").unbind("click").remove();this.activeSheet.vendorCss("Transition","all 0ms");var c=this.activeSheet,l=this.el;setTimeout(function(){c.vendorCss("Transition","all 300ms");c.cssTranslate("0,0px");setTimeout(function(){c.remove();c=null;l.style.overflow="none"},
500)},10)}};return m}()})(af);/*
 MIT - https://github.com/darius/requestAnimationFrame/commit/4f27a5a21902a883330da4663bea953b2f96cb15#diff-9879d6db96fd29134fc802214163b95a

    http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
    requestAnimationFrame polyfill by Erik M?ller. fixes from Paul Irish and Tino Zijdel
    MIT license

    Adapted from https://gist.github.com/paulirish/1579671 which derived from 
    http://paulirish.com/2011/requestanimationframe-for-smart-animating/
    http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating

    requestAnimationFrame polyfill by Erik M?ller.
    Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavi?, Darius Bacon
*/
(function(b){var n=[],m=function(c,g){var a,e;a="string"===typeof c||c instanceof String?document.getElementById(c):b.is$(c)?c[0]:c;a.afCSS3AnimateId||(a.afCSS3AnimateId=b.uuid());e=a.afCSS3AnimateId;n[e]?(n[e].animate(g),a=n[e]):(a=d(a,g),n[e]=a);return a};b.fn.css3Animate=function(b){!b.complete&&b.callback&&(b.complete=b.callback);var c=m(this[0],b);b.complete=null;b.sucess=null;b.failure=null;for(var a=1;a<this.length;a++)c.link(this[a],b);return c};b.css3AnimateQueue=function(){return new d.queue};
var f=b.feat.cssTransformStart,c=b.feat.cssTransformEnd,l=b.feat.cssPrefix.replace(/-/g,"")+"TransitionEnd",l=b.os.fennec||""===b.feat.cssPrefix||b.os.ie?"transitionend":l,l=l.replace(l.charAt(0),l.charAt(0).toLowerCase()),d=function(){var d=function(c,a){if(!(this instanceof d))return new d(c,a);this.callbacksStack=[];this.activeEvent=null;this.countStack=0;this.isActive=!1;this.el=c;this.linkFinishedProxy=b.proxy(this.linkFinished,this);if(this.el){this.animate(a);var e=this;af(this.el).bind("destroy",
function(){var a=e.el.afCSS3AnimateId;e.callbacksStack=[];n[a]&&delete n[a]})}};d.prototype={animate:function(g){this.isActive&&this.cancel();this.isActive=!0;if(g){var a=!!g.addClass,e,h,d=numOnly(g.time);if(a)g.removeClass?af(this.el).replaceClass(g.removeClass,g.addClass):af(this.el).addClass(g.addClass);else{0===d&&(g.time=0);g.y||(g.y=0);g.x||(g.x=0);g.previous&&(e=new b.getCssMatrix(this.el),g.y+=numOnly(e.f),g.x+=numOnly(e.e));g.origin||(g.origin="0% 0%");g.scale||(g.scale="1");g.rotateY||
(g.rotateY="0");g.rotateX||(g.rotateX="0");g.skewY||(g.skewY="0");g.skewX||(g.skewX="0");g.timingFunction||(g.timingFunction="linear");if("number"===typeof g.x||-1===g.x.indexOf("%")&&-1===g.x.toLowerCase().indexOf("px")&&-1===g.x.toLowerCase().indexOf("deg"))g.x=parseInt(g.x,10)+"px";if("number"===typeof g.y||-1===g.y.indexOf("%")&&-1===g.y.toLowerCase().indexOf("px")&&-1===g.y.toLowerCase().indexOf("deg"))g.y=parseInt(g.y,10)+"px";e="translate"+f+g.x+","+g.y+c+" scale("+parseFloat(g.scale)+") rotate("+
g.rotateX+")";b.os.opera||(e+=" rotateY("+g.rotateY+")");e+=" skew("+g.skewX+","+g.skewY+")";this.el.style[b.feat.cssPrefix+"Transform"]=e;this.el.style[b.feat.cssPrefix+"BackfaceVisibility"]="hidden";void 0!==g.opacity&&(this.el.style.opacity=g.opacity);g.width&&(this.el.style.width=g.width);g.height&&(this.el.style.height=g.height);this.el.style[b.feat.cssPrefix+"TransitionProperty"]="all";-1===(""+g.time).indexOf("s")?(e="ms",h=g.time+e):-1!==g.time.indexOf("ms")?(e="ms",h=g.time):(e="s",h=g.time+
e);g.delay&&(this.el.style[b.feat.cssPrefix+"TransitionDelay"]=g.delay);this.el.style[b.feat.cssPrefix+"TransitionDuration"]=h;this.el.style[b.feat.cssPrefix+"TransitionTimingFunction"]=g.timingFunction;this.el.style[b.feat.cssPrefix+"TransformOrigin"]=g.origin}this.callbacksStack.push({complete:g.complete,success:g.success,failure:g.failure});this.countStack++;var k=this;h=window.getComputedStyle(this.el);a&&(a=h[b.feat.cssPrefix+"TransitionDuration"],d=numOnly(a),g.time=d,-1!==a.indexOf("ms")?e=
"ms":(e="s",g.time*=1E3));0===d||"ms"===e&&5>d||"none"===h.display?b.asap(b.proxy(this.finishAnimation,this,[!1])):(this.activeEvent=function(a){clearTimeout(k.timeout);k.finishAnimation(a);k.el.removeEventListener(l,k.activeEvent,!1)},k.timeout=setTimeout(this.activeEvent,numOnly(g.time)+50),this.el.addEventListener(l,this.activeEvent,!1))}else window.alert("Please provide configuration options for animation of "+this.el.id)},addCallbackHook:function(b){b&&this.callbacksStack.push(b);this.countStack++;
return this.linkFinishedProxy},linkFinished:function(b){b?this.cancel():this.finishAnimation()},finishAnimation:function(b){b&&b.preventDefault&&b.preventDefault();this.isActive&&(this.countStack--,0===this.countStack&&this.fireCallbacks(!1))},fireCallbacks:function(b){this.clearEvents();var a=this.callbacksStack;this.cleanup();for(var e=0;e<a.length;e++){var h=a[e].complete,c=a[e].success,d=a[e].failure;"function"===typeof h&&h(b);b&&"function"===typeof d?d():"function"===typeof c&&c()}},cancel:function(){this.isActive&&
this.fireCallbacks(!0)},cleanup:function(){this.callbacksStack=[];this.isActive=!1;this.countStack=0},clearEvents:function(){this.activeEvent&&this.el.removeEventListener(l,this.activeEvent,!1);this.activeEvent=null},link:function(b,a){var e={complete:a.complete,success:a.success,failure:a.failure};a.complete=this.addCallbackHook(e);a.success=null;a.failure=null;m(b,a);a.complete=e.complete;a.success=e.success;a.failure=e.failure;return this}};return d}();d.queue=function(){return{elements:[],push:function(b){this.elements.push(b)},
pop:function(){return this.elements.pop()},run:function(){var b=this;if(0!==this.elements.length&&("function"===typeof this.elements[0]&&this.shift()(),0!==this.elements.length)){var c=this.shift();0<this.elements.length&&(c.complete=function(a){a||b.run()});d(document.getElementById(c.id),c)}},shift:function(){return this.elements.shift()}}}})(af);Date.now||(Date.now=function(){return(new Date).getTime()});
(function(){for(var b=["webkit","moz","ms"],n=0;n<b.length&&!window.requestAnimationFrame;++n){var m=b[n];window.requestAnimationFrame=window[m+"RequestAnimationFrame"];window.cancelAnimationFrame=window[m+"CancelAnimationFrame"]||window[m+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var f=0;window.requestAnimationFrame=function(b){var l=Date.now(),d=Math.max(f+16,l);return setTimeout(function(){b(f=
d)},d-l)};window.cancelAnimationFrame=clearTimeout}})();
(function(b){var n=[];b.fn.animate=function(c){var l,d="string"===typeof this[0]||this[0]instanceof String?document.getElementById(this[0]):b.is$(this[0])?this[0][0]:this[0];d.afAnimateId||(d.afAnimateId=b.uuid());l=d.afAnimateId;n[l]?(c&&n[l].animate(c),c=n[l]):(c=m(d,c),n[l]=c);return c};var m=function(b,l){if(!(this instanceof m))return new m(b,l);if(this.el=b){l&&this.animate(l);var d=this;af(this.el).bind("destroy",function(){var b=d.el.afAnimateId;n[b]&&delete n[b]})}};m.prototype={animationTimer:null,
isAnimating:!1,startX:0,startY:0,runTime:0,endX:0,endY:0,currX:0,currY:0,animationStartTime:0,pauseTime:0,completeCB:null,easingFn:"linear",animateOpts:{},updateCb:null,animate:function(c){this.isAnimating||(this.isAnimating=!0,window.cancelAnimationFrame(this.animationTimer),c||(c={x:0,y:0,duration:0}),this.easingFn=c.easing||"linear",this.completeCB=c.complete||null,this.updateCB=c.update||null,this.runTime=numOnly(c.duration),c.complete&&delete c.complete,this.animateOpts=c,this.startTime=Date.now(),
this.startMatrix=b.getCssMatrix(this.el),0===this.runTime&&this.doAnimate())},start:function(){this.doAnimate()},doAnimate:function(){var b=Date.now(),l,d=this;0===this.runTime||b>=this.startTime+this.runTime?(d.setPosition(this.animateOpts.x,this.animateOpts.y),d.isAnimating=!1,this.updateCB&&this.updateCB({x:this.animateOpts.x,y:this.animateOpts.y}),this.completeCB&&this.completeCB()):(b=(b-this.startTime)/this.runTime,l=f[this.easingFn](1<b?1:b),b=(this.animateOpts.x-this.startMatrix.e)*l+this.startMatrix.e,
l=(this.animateOpts.y-this.startMatrix.f)*l+this.startMatrix.f,this.setPosition(b,l),this.updateCB&&this.updateCB({x:b,y:l}),this.isAnimating&&(this.animationTimer=window.requestAnimationFrame(function(){d.doAnimate()})))},setPosition:function(c,l){this.el.style[b.feat.cssPrefix+"Transform"]="matrix3d( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+c+", "+l+", 0, 1 )";this.currX=c;this.currY=l},stop:function(){this.isAnimating=!1;window.cancelAnimationFrame(this.animationTimer);this.pauseTime=Date.now()-this.startTime},
resume:function(){this.isAnimating=!0;this.startTime=Date.now()-this.pauseTime;this.doAnimate()}};var f={linear:function(b){return b},easeOutSine:function(b){return Math.sin(b*Math.PI/2)}}})(af);(function(b){var n=!1,m=function(a){a.preventDefault();a.stopPropagation()},f=function(a,e,h){h=h?h:e.target;-1===h.tagName.toUpperCase().indexOf("SELECT")&&(-1===h.tagName.toUpperCase().indexOf("TEXTAREA")&&-1===h.tagName.toUpperCase().indexOf("INPUT"))&&m(e);var c=document.createEvent("MouseEvent");c.initEvent(a,!0,!0);c.initMouseEvent(a,!0,!0,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.button,e.relatedTarget);"touchend"!==a&&(c.touches=[],c.touches[0]=
{},c.touches[0].pageX=e.pageX,c.touches[0].pageY=e.pageY,c.touches[0].target=h,c.changedTouches=c.touches,c.targetTouches=c.touches);c.mouseToTouch=!0;if(b.os.ie)for(e=e.target;null!==e;)e.hasAttribute("on"+a)&&eval(e.getAttribute("on"+a)),e=e.parentElement;h.dispatchEvent(c)},c=!1,l=null,d=0,k=0;if(window.navigator.msPointerEnabled){var g=!1;document.addEventListener("MSPointerDown",function(a){g=c=!0;l=a.target;"a"===a.target.nodeName.toLowerCase()&&"javascript:;"===a.target.href.toLowerCase()&&
(a.target.href="");f("touchstart",a);n=!1;d=a.clientX;k=a.clientY},!0);document.addEventListener("MSPointerUp",function(a){c&&(f("touchend",a,l),l=null,c=!1)},!0);document.addEventListener("MSPointerMove",function(a){g?g=!1:!(a.clientX===d&&a.clientY===k)&&c&&(f("touchmove",a,l),a.preventDefault(),n=!0)},!0)}else document.addEventListener("mousedown",function(a){c=!0;l=a.target;"a"===a.target.nodeName.toLowerCase()&&"javascript:;"===a.target.href.toLowerCase()&&(a.target.href="#");f("touchstart",
a);n=!1;d=a.clientX;k=a.clientY},!0),document.addEventListener("mouseup",function(a){c&&(f("touchend",a,l),l=null,c=!1)},!0),document.addEventListener("mousemove",function(a){!(a.clientX===d&&a.clientY===k)&&c&&(f("touchmove",a,l),a.preventDefault(),n=!0)},!0);document.addEventListener("drag",m,!0);document.addEventListener("dragstart",m,!0);document.addEventListener("dragenter",m,!0);document.addEventListener("dragover",m,!0);document.addEventListener("dragleave",m,!0);document.addEventListener("dragend",
m,!0);document.addEventListener("drop",m,!0);document.addEventListener("selectstart",function(a){var b=a.target;-1===b.tagName.toUpperCase().indexOf("SELECT")&&(-1===b.tagName.toUpperCase().indexOf("TEXTAREA")&&-1===b.tagName.toUpperCase().indexOf("INPUT"))&&m(a)},!0);document.addEventListener("click",function(a){!a.mouseToTouch&&a.target===l&&m(a);n&&(m(a),n=!1)},!0);window.addEventListener("resize",function(){var a=document.createEvent("Event");a.initEvent("orientationchange",!0,!0);document.dispatchEvent(a)},
!1)})(af);/*
 2011 - Intel
*/
(function(b){b.passwordBox=function(){return new n};var n=function(){this.oldPasswords={}};n.prototype={showPasswordPlainText:!1,getOldPasswords:function(m){var f=m&&document.getElementById(m)?document.getElementById(m):document;if(f){m=f.getElementsByTagName("input");for(f=0;f<m.length;f++)"password"===m[f].type&&b.os.webkit&&(m[f].type="text",b(m[f]).vendorCss("TextSecurity","disc"))}else window.alert("Could not find container element for passwordBox "+m)},changePasswordVisiblity:function(m,f){m=
parseInt(m,10);var c=document.getElementById(f);1===m?b(c).vendorCss("TextSecurity","none"):b(c).vendorCss("TextSecurity","disc");b.os.webkit||(c.type=1===m?"text":"password")}}})(af);(function(b){b.fn.popup=function(b){return new m(this[0],b)};var n=[],m=function(){var c=function(c,d){if(this.container="string"===typeof c||c instanceof String?document.getElementById(c):c)try{if("string"===typeof d||"number"===typeof d)d={message:d,cancelOnly:"true",cancelText:"OK"};this.id=d.id=d.id||b.uuid();this.addCssClass=d.addCssClass?d.addCssClass:"";this.title=d.suppressTitle?"":d.title||"Alert";this.message=d.message||"";this.cancelText=d.cancelText||"Cancel";this.cancelCallback=d.cancelCallback||
function(){};this.cancelClass=d.cancelClass||"button";this.doneText=d.doneText||"Done";this.doneCallback=d.doneCallback||function(){};this.doneClass=d.doneClass||"button";this.cancelOnly=d.cancelOnly||!1;this.onShow=d.onShow||function(){};this.autoCloseDone=void 0!==d.autoCloseDone?d.autoCloseDone:!0;n.push(this);1===n.length&&this.show()}catch(f){console.log("error adding popup "+f)}else window.alert("Error finding container for popup "+c)};c.prototype={id:null,addCssClass:null,title:null,message:null,
cancelText:null,cancelCallback:null,cancelClass:null,doneText:null,doneCallback:null,doneClass:null,cancelOnly:!1,onShow:null,autoCloseDone:!0,supressTitle:!1,show:function(){var c=this,d="<div id='"+this.id+"' class='afPopup hidden "+this.addCssClass+"'><header>"+this.title+"</header><div>"+this.message+"</div><footer><a href='javascript:;' class='"+this.cancelClass+"' id='cancel'>"+this.cancelText+"</a><a href='javascript:;' class='"+this.doneClass+"' id='action'>"+this.doneText+"</a><div style='clear:both'></div></footer></div>";
b(this.container).append(b(d));var f=b.query("#"+this.id);f.bind("close",function(){c.hide()});this.cancelOnly&&(f.find("A#action").hide(),f.find("A#cancel").addClass("center"));f.find("A").each(function(){var d=b(this);d.bind("click",function(a){"cancel"===d.attr("id")?(c.cancelCallback.call(c.cancelCallback,c),c.hide()):(c.doneCallback.call(c.doneCallback,c),c.autoCloseDone&&c.hide());a.preventDefault()})});c.positionPopup();b.blockUI(0.5);f.bind("orientationchange",function(){c.positionPopup()});
f.find("header").show();f.find("footer").show();setTimeout(function(){f.removeClass("hidden");c.onShow(c)},50)},hide:function(){var c=this;b.query("#"+c.id).addClass("hidden");b.unblockUI();!b.os.ie&&!b.os.android?setTimeout(function(){c.remove()},250):c.remove()},remove:function(){var c=b.query("#"+this.id);c.unbind("close");c.find("BUTTON#action").unbind("click");c.find("BUTTON#cancel").unbind("click");c.unbind("orientationchange").remove();n.splice(0,1);0<n.length&&n[0].show()},positionPopup:function(){var c=
b.query("#"+this.id);c.css("top",window.innerHeight/2.5+window.pageYOffset-c[0].clientHeight/2+"px");c.css("left",window.innerWidth/2-c[0].clientWidth/2+"px")}};return c}(),f=!1;b.blockUI=function(c){f||(c=c?" style='opacity:"+c+";'":"",b.query("BODY").prepend(b("<div id='mask'"+c+"></div>")),b.query("BODY DIV#mask").bind("touchstart",function(b){b.preventDefault()}),b.query("BODY DIV#mask").bind("touchmove",function(b){b.preventDefault()}),f=!0)};b.unblockUI=function(){f=!1;b.query("BODY DIV#mask").unbind("touchstart");
b.query("BODY DIV#mask").unbind("touchmove");b("BODY DIV#mask").remove()}})(af);(function(b){if(!b||!b.ui)throw"This plugin requires App Framework UI";b.extend(b.ui,{_hideHeaderOnScroll:!1,_hideFooterOnScroll:!1,hideHeaderOnScroll:function(){console.log(this);this._hideHeaderOnScroll=!0;this.setupScrollStart()},hideFooterOnScroll:function(){this._hideFooterOnScroll=!0;this.setupScrollStart()}});b.ui.ready(function(){var n=!1,m=!1,f=0,c=0,l,d,k=!1,g;for(g in b.ui.scrollingDivs)b.ui.scrollingDivs[g].initScrollProgress=!0,b.ui.scrollingDivs[g].lockBounce=!1;var a=b.ui.addDivAndScroll;
b.ui.addDivAndScroll=function(){var e=a.apply(b.ui,arguments);b.ui.scrollingDivs[e].initScrollProgress=n||m;b.ui.scrollingDivs[e].lockBounce=!1};b.ui.setupScrollStart=function(){k||(b.bind(b.touchLayer,"scrollstart",e),b.bind(b.touchLayer,"scroll",h),k=!0)};b.ui.removeScrollStart=function(){b.unbind(b.touchLayer,"scrollstart",h)};var e=function(a,b){f=null;c=0},h=function(a){f||(f=a.y);var e;a.y<c&&80<Math.abs(a.y)-Math.abs(f)&&(b.ui._hideHeaderOnScroll&&!n&&(n=!0,e=b("#header"),l=e.css("height"),
e.vendorCss("TransitionDuration","200ms"),e.css("height","0px"),f=a.y),b.ui._hideFooterOnScroll&&!m&&(m=!0,e=b("#navbar"),d=e.css("height"),e.vendorCss("TransitionDuration","200ms"),e.css("height","0px"),f=a.y));a.y>c&&-40>Math.abs(a.y)-Math.abs(f)&&(n&&b.ui._hideHeaderOnScroll&&(n=!1,e=b("#header"),e.css("height",l),f=a.y),m&&b.ui._hideFooterOnScroll&&(m=!1,e=b("#navbar"),e.css("height",d),f=a.y));c=a.y},q=b.ui.loadContent;b.ui.loadContent=function(){n&&b("#header").css("height",l);m&&b("#navbar").css("height",
d);b("#header").vendorCss("TransitionDuration","");q.apply(b.ui,arguments);m=n=!1};b.ui.hideHeaderOnScroll();b.ui.hideFooterOnScroll()})})(af);/*
 Intel
*/
(function(b){function n(){if(b.os.android&&!b.os.chrome&&b.os.webkit){var c=!1;b.bind(b.touchLayer,["cancel-enter-edit","exit-edit"],function(){if(c){c=!1;for(var b in m){var f;m[b].el?f=!0:(delete m[b],f=!1);f&&m[b].androidFormsMode&&m[b].stopFormsMode()}}})}f=!0}var m=[];b.fn.scroller=function(f){for(var d,k,g=0;g<this.length;g++)d=this[g],d.afScrollerId||(d.afScrollerId=b.uuid()),k=d.afScrollerId,m[k]?d=m[k]:(f||(f={}),b.feat.nativeTouchScroll||(f.useJsScroll=!0),d=c(this[g],f),m[k]=d);return 1===
this.length?d:this};var f=!1,c=function(){function c(a,e){var h=document.createElement("div");h.style.position="absolute";h.style.width=a+"px";h.style.height=e+"px";h.style[b.feat.cssPrefix+"BorderRadius"]="2px";h.style.borderRadius="2px";h.style.display="none";h.className="scrollBar";h.style.background="black";return h}var d,k,g=function(a,e){this.el=a;this.afEl=b(this.el);for(var h in e)this[h]=e[h]};g.prototype={refresh:!1,refreshContent:"Pull to Refresh",refreshHangTimeout:2E3,refreshHeight:60,
refreshElement:null,refreshCancelCB:null,refreshRunning:!1,scrollTop:0,scrollLeft:0,preventHideRefresh:!0,verticalScroll:!0,horizontalScroll:!1,refreshTriggered:!1,moved:!1,eventsActive:!1,rememberEventsActive:!1,scrollingLocked:!1,autoEnable:!0,blockFormsFix:!1,loggedPcentY:0,loggedPcentX:0,infinite:!1,infiniteEndCheck:!1,infiniteTriggered:!1,scrollSkip:!1,scrollTopInterval:null,scrollLeftInterval:null,bubbles:!0,lockBounce:!1,initScrollProgress:!1,_scrollTo:function(a,b){b=parseInt(b,10);if(0===
b||isNaN(b))this.el.scrollTop=Math.abs(a.y),this.el.scrollLeft=Math.abs(a.x);else{var h=(this.el.scrollTop-a.y)/Math.ceil(b/10),c=(this.el.scrollLeft-a.x)/Math.ceil(b/10),d=this,g=Math.ceil(this.el.scrollTop-a.y)/h,f=Math.ceil(this.el.scrollLeft-a.x)/h,l=0,k=0;d.scrollTopInterval=window.setInterval(function(){d.el.scrollTop-=h;k++;k>=g&&(d.el.scrollTop=a.y,clearInterval(d.scrollTopInterval))},10);d.scrollLeftInterval=window.setInterval(function(){d.el.scrollLeft-=c;l++;l>=f&&(d.el.scrollLeft=a.x,
clearInterval(d.scrollLeftInterval))},10)}},enable:function(){},disable:function(){},hideScrollbars:function(){},addPullToRefresh:function(){},_scrollToTop:function(a){this._scrollTo({x:0,y:0},a)},_scrollToBottom:function(a){this._scrollTo({x:0,y:this.el.scrollHeight-this.el.offsetHeight},a)},scrollToBottom:function(a){return this._scrollToBottom(a)},scrollToTop:function(a){return this._scrollToTop(a)},init:function(a,e){this.el=a;this.afEl=b(this.el);this.defaultProperties();for(var h in e)this[h]=
e[h];var c=this,d=function(a){c.eventsActive&&(!b.feat.nativeTouchScroll&&(!b.ui||b.ui.activeDiv===c.container))&&c.adjustScroll()};this.afEl.bind("destroy",function(){c.disable(!0);var a=c.el.afScrollerId;m[a]&&delete m[a];b.unbind(b.touchLayer,"orientationchange-reshape",d)});b.bind(b.touchLayer,"orientationchange-reshape",d);b(window).bind("resize",d)},needsFormsFix:function(a){return this.useJsScroll&&this.isEnabled()&&"none"!==this.el.style.display&&0<b(a).closest(this.afEl).size()},handleEvent:function(a){if(!this.scrollingLocked)switch(a.type){case "touchstart":clearInterval(this.scrollTopInterval);
this.preventHideRefresh=!this.refreshRunning;this.moved=!1;this.onTouchStart(a);this.bubbles||a.stopPropagation();break;case "touchmove":this.onTouchMove(a);this.bubbles||a.stopPropagation();break;case "touchend":this.onTouchEnd(a);this.bubbles||a.stopPropagation();break;case "scroll":this.onScroll(a)}},coreAddPullToRefresh:function(a){a&&(this.refreshElement=a);null===this.refreshElement?(a=document.getElementById(this.container.id+"_pulldown"),a=null!==a?b(a):b("<div id='"+this.container.id+"_pulldown' class='afscroll_refresh' style='position:relative;height:60px;text-align:center;line-height:60px;font-weight:bold;'>"+
this.refreshContent+"</div>")):a=b(this.refreshElement);a=a.get(0);this.refreshContainer=b("<div style='overflow:hidden;height:0;width:100%;display:none;background:inherit;-webkit-backface-visibility: hidden !important;'></div>");b(this.el).prepend(this.refreshContainer.prepend(a));this.refreshContainer=this.refreshContainer[0]},fireRefreshRelease:function(a){if(this.refresh&&a&&(this.setRefreshContent("Refreshing..."),a=!1!==b.trigger(this,"refresh-release",[a]),this.preventHideRefresh=!1,this.refreshRunning=
!0,a)){var e=this;0<this.refreshHangTimeout&&(this.refreshCancelCB=setTimeout(function(){e.hideRefresh()},this.refreshHangTimeout))}},setRefreshContent:function(a){b(this.container).find(".afscroll_refresh").html(a)},lock:function(){this.scrollingLocked||(this.scrollingLocked=!0,(this.rememberEventsActive=this.eventsActive)&&this.disable())},unlock:function(){this.scrollingLocked&&(this.scrollingLocked=!1,this.rememberEventsActive&&this.enable())},scrollToItem:function(a,e){b.is$(a)||(a=b(a));var h,
c;"bottom"===e?(h=a.offset(),h=h.top-this.afEl.offset().bottom+h.height,h+=4):(h=a.offset().top,h-=document.body.scrollTop,c=this.afEl.offset().top,document.body.scrollTop<c&&(h-=c),h-=4);this.scrollBy({y:h,x:0},0)},setPaddings:function(a,e){var h=b(this.el),c=numOnly(h.css("paddingTop"));h.css("paddingTop",a+"px").css("paddingBottom",e+"px");this.scrollBy({y:a-c,x:0})},divide:function(a,b){return 0!==b?a/b:0},isEnabled:function(){return this.eventsActive},addInfinite:function(){this.infinite=!0},
clearInfinite:function(){this.infiniteTriggered=!1;this.scrollSkip=!0},scrollTo:function(a,b){return this._scrollTo(a,b)},updateP2rHackPosition:function(){}};d=function(a,e){this.init(a,e);if(e.hasParent)this.container=this.el.parentNode;else{var h=b.create("div",{});h.append(b(this.el).contents());b(this.el).append(h);this.container=this.el;this.el=h.get(0)}this.container.afScrollerId=a.afScrollerId;this.afEl=b(this.container);"hidden"!==this.container.style.overflow&&(this.container.style.overflow=
"hidden");this.addPullToRefresh(null,!0);e.autoEnable&&(this.autoEnable=e.autoEnable);this.autoEnable&&this.enable(!0);this.verticalScroll&&(!0===this.verticalScroll&&!0===this.scrollBars)&&(h=c(5,20),h.style.top="0px",this.vScrollCSS&&(h.className=this.vScrollCSS),h.style.display="none",this.container.appendChild(h),this.vscrollBar=h);this.horizontalScroll&&(!0===this.horizontalScroll&&!0===this.scrollBars)&&(h=c(20,5),h.style.bottom="0px",this.hScrollCSS&&(h.className=this.hScrollCSS),h.style.display=
"none",this.container.appendChild(h),this.hscrollBar=h);this.horizontalScroll&&(this.el.style.cssFloat="left");this.el.hasScroller=!0};k=function(a,e){e.nativeParent&&(a=a.parentNode);this.init(a,e);var h=b(a);if(!0===e.replaceParent){var c=h.parent();h.css("height",c.height()).css("width",c.width());h.insertBefore(h.parent());c.remove()}this.container=this.el;h.css("-webkit-overflow-scrolling","touch");e.autoEnable&&(this.autoEnable=e.autoEnable);this.autoEnable&&this.enable()};k.prototype=new g;
d.prototype=new g;k.prototype.defaultProperties=function(){this.refreshContainer=null;this.dX=this.cX=this.dY=this.cY=0;this.cancelPropagation=!1;this.yReset=this.xReset=this.loggedPcentX=this.loggedPcentY=0;var a=this;this.adjustScrollOverflowProxy=function(){a.afEl.css("overflow","auto");a.afEl.parent().css("overflow","hidden")}};k.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,this.el.style.overflow="auto",a||this.adjustScroll(),this.el.addEventListener("touchstart",this,
!1),this.el.addEventListener("scroll",this,!1),this.updateP2rHackPosition())};k.prototype.disable=function(a){this.eventsActive&&(this.logPos(this.el.scrollLeft,this.el.scrollTop),!a&&!b.ui&&(this.el.style.overflow="hidden"),this.el.removeEventListener("touchstart",this,!1),this.el.removeEventListener("touchmove",this,!1),this.el.removeEventListener("touchend",this,!1),this.el.removeEventListener("scroll",this,!1),this.eventsActive=!1)};k.prototype.addPullToRefresh=function(a,b){b||(this.refresh=
!0);this.refresh&&!0===this.refresh&&(this.coreAddPullToRefresh(a),this.refreshContainer.style.position="absolute",this.refreshContainer.style.top="-60px",this.refreshContainer.style.height="60px",this.refreshContainer.style.display="block",this.updateP2rHackPosition())};k.prototype.updateP2rHackPosition=function(){if(!this.refresh)return b(this.el).find(".p2rhack").remove();var a=b(this.el).find(".p2rhack");0===a.length&&(b(this.el).append("<div class='p2rhack' style='position:absolute;width:1px;height:1px;opacity:0;background:transparent;z-index:-1;-webkit-transform:translate3d(-1px,0,0);'></div>"),
a=b(this.el).find(".p2rhack"));a.css("top",this.el.scrollHeight+this.refreshHeight+1+"px")};k.prototype.onTouchStart=function(a){this.lastScrollInfo={top:0};this.xReset=this.yReset=0;this.verticalScroll&&(0===this.el.scrollTop&&this.refresh&&(this.el.scrollTop=1,this.yReset=-1),this.el.scrollTop===this.el.scrollHeight-this.el.clientHeight&&this.infinite&&(this.el.scrollTop-=1,this.yReset=1));this.horizontalScroll&&(0===this.el.scrollLeft&&(this.el.scrollLeft=1,this.xReset=-1),this.el.scrollLeft===
this.el.scrollWidth-this.el.clientWidth&&(this.el.scrollLeft-=1,this.xReset=1));this.refreshCancelCB&&clearTimeout(this.refreshCancelCB);this.refresh&&this.el.addEventListener("touchend",this,!1);this.el.addEventListener("touchmove",this,!1);this.dY=a.touches[0].pageY;this.dX=a.touches[0].pageX;this.startTop=this.el.scrollTop;this.startLeft=this.el.scrollLeft;(this.refresh||this.infinite)&&this.refresh&&0>this.dY&&this.showRefresh()};k.prototype.onTouchMove=function(a){var e=a.touches[0].pageY-this.dY,
h=a.touches[0].pageX-this.dX,c=this.el.scrollHeight-this.el.scrollTop===this.el.clientHeight&&0>e,d=this.el.scrollWidth-this.el.scrollLeft===this.el.clientWidth&&0>h,g="input"!==a.target.tagName.toLowerCase();this.verticalScroll&&0===this.startTop&&0===this.el.scrollTop&&0<e&&g&&a.preventDefault();this.horizontalScroll&&0===this.startTop&&0===this.el.scrollLeft&&0<h&&g&&a.preventDefault();this.verticalScroll&&c&&g&&a.preventDefault();this.horizontalScroll&&d&&g&&a.preventDefault();this.moved||(b.trigger(this,
"scrollstart",[this.el,{x:h,y:e}]),b.trigger(b.touchLayer,"scrollstart",[this.el,{x:h,y:e}]),this.refresh||this.el.addEventListener("touchend",this,!1),this.moved=!0);this.horizontalScroll&&Math.abs(e)>Math.abs(h)&&a.preventDefault();this.refresh&&this.el.scrollTop<-this.refreshHeight?this.showRefresh():this.refresh&&this.refreshTriggered&&this.refreshRunning&&this.el.scrollTop>this.refreshHeight?(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&&clearTimeout(this.refreshCancelCB),
this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel")):this.refresh&&(this.refreshTriggered&&!this.refreshRunning&&this.el.scrollTop>-this.refreshHeight)&&(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&&clearTimeout(this.refreshCancelCB),this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel"));this.cY=e;this.cX=h;this.lastScrollInfo.top=this.cY;this.initScrollProgress&&(b.trigger(this,"scroll",[{x:-this.el.scrollLeft,
y:-this.el.scrollTop}]),b.trigger(b.touchLayer,"scroll",[{x:-this.el.scrollLeft,y:-this.el.scrollTop}]))};k.prototype.showRefresh=function(){this.refreshTriggered||(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),b.trigger(this,"refresh-trigger"))};k.prototype.onTouchEnd=function(a){a=this.el.scrollTop<=-this.refreshHeight;this.fireRefreshRelease(a,!0);this.moved||(this.el.scrollTop+=this.yReset,this.el.scrollLeft+=this.xReset);if(a&&this.refresh){var e=b.create("<div style='height:"+
this.el.clientHeight+this.refreshHeight+"px;width:1px;-webkit-transform:translated3d(-1px,0,0)'></div>");b(this.el).append(e);this.refreshContainer.style.top="0px";this.refreshContainer.style.position="";setTimeout(function(){e.remove()})}this.el.removeEventListener("touchmove",this,!1);this.el.removeEventListener("touchend",this,!1);this.infiniteEndCheck=!0;this.infinite&&(!this.infiniteTriggered&&this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,b.trigger(this,
"infinite-scroll"),this.infiniteEndCheck=!0);this.touchEndFired=!0;var h=this,c=this.el.scrollTop,d=this.el.scrollLeft,g=0;clearInterval(h.nativePolling);h.nativePolling=setInterval(function(){g++;25===g&&h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft+h.cX,y:-h.el.scrollTop+h.cY}]),b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft+h.cX,y:-h.el.scrollTop+h.cY}]));if(200<=g)clearInterval(h.nativePolling),h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]),
b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]));else if(h.el.scrollTop!==c||h.el.scrollLeft!==d)clearInterval(h.nativePolling),b.trigger(b.touchLayer,"scrollend",[h.el]),b.trigger(h,"scrollend",[h.el]),h.initScrollProgress&&(b.trigger(h,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]),b.trigger(b.touchLayer,"scroll",[{x:-h.el.scrollLeft,y:-h.el.scrollTop}]))},20)};k.prototype.hideRefresh=function(a){if(!this.preventHideRefresh){var e=this,h=function(a){e.refreshContainer.style.top=
"-60px";e.refreshContainer.style.position="absolute";e.dY=e.cY=0;a||(e.el.style[b.feat.cssPrefix+"Transform"]="none",e.el.style[b.feat.cssPrefix+"TransitionProperty"]="none",e.el.scrollTop=0,e.logPos(e.el.scrollLeft,0),e.refreshRunning=!1,e.setRefreshContent("Pull to Refresh"),b.trigger(e,"refresh-finish"))};!1===a||!e.afEl.css3Animate?h():e.afEl.css3Animate({y:e.el.scrollTop-e.refreshHeight+"px",x:"0%",time:"325ms",complete:h});this.refreshTriggered=!1}};k.prototype.hideScrollbars=function(){};k.prototype.scrollTo=
function(a,b){this.logPos(a.x,a.y);a.x*=-1;a.y*=-1;return this._scrollTo(a,b)};k.prototype.scrollBy=function(a,b){a.x+=this.el.scrollLeft;a.y+=this.el.scrollTop;this.logPos(this.el.scrollLeft,this.el.scrollTop);return this._scrollTo(a,b)};k.prototype.scrollToBottom=function(a){this._scrollToBottom(a);this.logPos(this.el.scrollLeft,this.el.scrollTop)};k.prototype.onScroll=function(a){this.infinite&&this.touchEndFired?this.touchEndFired=!1:this.scrollSkip?this.scrollSkip=!1:(this.infinite&&(!this.infiniteTriggered&&
this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,b.trigger(this,"infinite-scroll"),this.infiniteEndCheck=!0),this.infinite&&(this.infiniteEndCheck&&this.infiniteTriggered)&&(this.infiniteEndCheck=!1,b.trigger(this,"infinite-scroll-end")))};k.prototype.logPos=function(a,b){this.loggedPcentX=this.divide(a,this.el.scrollWidth);this.loggedPcentY=this.divide(b,this.el.scrollHeight);this.scrollLeft=a;this.scrollTop=b;isNaN(this.loggedPcentX)&&(this.loggedPcentX=
0);isNaN(this.loggedPcentY)&&(this.loggedPcentY=0)};k.prototype.adjustScroll=function(){this.adjustScrollOverflowProxy();this.el.scrollLeft=this.loggedPcentX*this.el.scrollWidth;this.el.scrollTop=this.loggedPcentY*this.el.scrollHeight;this.logPos(this.el.scrollLeft,this.el.scrollTop)};d.prototype.defaultProperties=function(){this.boolScrollLock=!1;this.elementInfo=this.currentScrollingObject=null;this.verticalScroll=!0;this.horizontalScroll=!1;this.scrollBars=!0;this.hscrollBar=this.vscrollBar=null;
this.vScrollCSS=this.hScrollCSS="scrollBar";this.firstEventInfo=null;this.moved=!1;this.preventPullToRefresh=!0;this.refreshSafeKeep=this.androidFormsMode=this.isScrolling=!1;this.lastScrollbar="";this.scrollingFinishCB=this.container=this.finishScrollingObject=null;this.androidPerfHack=this.loggedPcentX=this.loggedPcentY=0};d.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,a?this.scrollerMoveCSS({x:0,y:0},0):this.adjustScroll(),this.container.addEventListener("touchstart",this,
!1),this.container.addEventListener("touchmove",this,!1),this.container.addEventListener("touchend",this,!1))};d.prototype.adjustScroll=function(){var a=this.getViewportSize();this.scrollerMoveCSS({x:Math.round(this.loggedPcentX*(this.el.clientWidth-a.w)),y:Math.round(this.loggedPcentY*(this.el.clientHeight-a.h))},0)};d.prototype.disable=function(){if(this.eventsActive){var a=this.getCSSMatrix(this.el);this.logPos(numOnly(a.e)-numOnly(this.container.scrollLeft),numOnly(a.f)-numOnly(this.container.scrollTop));
this.container.removeEventListener("touchstart",this,!1);this.container.removeEventListener("touchmove",this,!1);this.container.removeEventListener("touchend",this,!1);this.eventsActive=!1}};d.prototype.addPullToRefresh=function(a,b){b||(this.refresh=!0);this.refresh&&!0===this.refresh&&(this.coreAddPullToRefresh(a),this.el.style.overflow="visible")};d.prototype.hideScrollbars=function(){this.hscrollBar&&(this.hscrollBar.style.display="none",this.hscrollBar.style[b.feat.cssPrefix+"TransitionDuration"]=
"0ms");this.vscrollBar&&(this.vscrollBar.style.display="none",this.vscrollBar.style[b.feat.cssPrefix+"TransitionDuration"]="0ms")};d.prototype.getViewportSize=function(){var a=window.getComputedStyle(this.container);isNaN(numOnly(a.paddingTop))&&window.alert(typeof a.paddingTop+"::"+a.paddingTop+":");return{h:this.container.clientHeight>window.innerHeight?window.innerHeight:this.container.clientHeight-numOnly(a.paddingTop)-numOnly(a.paddingBottom),w:this.container.clientWidth>window.innerWidth?window.innerWidth:
this.container.clientWidth-numOnly(a.paddingLeft)-numOnly(a.paddingRight)}};d.prototype.onTouchStart=function(a){this.moved=!1;this.currentScrollingObject=null;b(this.el).animate().stop();if(this.container&&(this.refreshCancelCB&&(clearTimeout(this.refreshCancelCB),this.refreshCancelCB=null),this.scrollingFinishCB&&(clearTimeout(this.scrollingFinishCB),this.scrollingFinishCB=null),!(1!==a.touches.length||this.boolScrollLock)&&!(a.touches[0].target&&void 0!==a.touches[0].target.type&&"select"===a.touches[0].target.tagName.toLowerCase()))){var e=
{top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0};this.elementInfo={};var h=this.getViewportSize();this.elementInfo.bottomMargin=h.h;this.elementInfo.maxTop=this.el.clientHeight-this.elementInfo.bottomMargin;0>this.elementInfo.maxTop&&(this.elementInfo.maxTop=0);this.elementInfo.divHeight=this.el.clientHeight;this.elementInfo.rightMargin=h.w;this.elementInfo.maxLeft=this.el.clientWidth-this.elementInfo.rightMargin;0>this.elementInfo.maxLeft&&
(this.elementInfo.maxLeft=0);this.elementInfo.divWidth=this.el.clientWidth;this.elementInfo.hasVertScroll=this.verticalScroll||0<this.elementInfo.maxTop;this.elementInfo.hasHorScroll=0<this.elementInfo.maxLeft;this.elementInfo.requiresVScrollBar=this.vscrollBar&&this.elementInfo.hasVertScroll;this.elementInfo.requiresHScrollBar=this.hscrollBar&&this.elementInfo.hasHorScroll;this.saveEventInfo(a);this.saveFirstEventInfo(a);a=this.getCSSMatrix(this.el);e.top=numOnly(a.f)-numOnly(this.container.scrollTop);
e.left=numOnly(a.e)-numOnly(this.container.scrollLeft);this.container.scrollTop=this.container.scrollLeft=0;this.currentScrollingObject=this.el;this.refresh&&0===e.top?(this.refreshContainer.style.display="block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight,this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh=!1):0>e.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow=
"hidden"));e.x=e.left;e.y=e.top;this.setVScrollBar(e,0,0)&&(this.vscrollBar.style.right="0px",this.vscrollBar.style[b.feat.cssPrefix+"Transition"]="",b(this.vscrollBar).animate().stop());this.setHScrollBar(e,0,0)&&(this.container.clientHeight>window.innerHeight?this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom=numOnly(this.hscrollBar.style.height),this.hscrollBar.style[b.feat.cssPrefix+"Transition"]="",b(this.hscrollBar).animate().stop());
this.lastScrollInfo=e;this.hasMoved=!1;0===this.elementInfo.maxTop&&0===this.elementInfo.maxLeft&&this.lockBounce?this.scrollToTop(0):this.scrollerMoveCSS(this.lastScrollInfo,0);this.scrollerMoveCSS(this.lastScrollInfo,0)}};d.prototype.getCSSMatrix=function(a){if(this.androidFormsMode){var e=parseInt(a.style.marginTop,10);a=parseInt(a.style.marginLeft,10);isNaN(e)&&(e=0);isNaN(a)&&(a=0);return{f:e,e:a}}return b.getCssMatrix(a)};d.prototype.saveEventInfo=function(a){this.lastEventInfo={pageX:a.touches[0].pageX,
pageY:a.touches[0].pageY,time:a.timeStamp}};d.prototype.saveFirstEventInfo=function(a){this.firstEventInfo={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY,time:a.timeStamp}};d.prototype.setVScrollBar=function(a,b,h){if(!this.elementInfo.requiresVScrollBar)return!1;var c=parseFloat(this.elementInfo.bottomMargin/this.elementInfo.divHeight)*this.elementInfo.bottomMargin+"px";numOnly(c)>this.elementInfo.bottomMargin&&(c=this.elementInfo.bottomMargin+"px");c!==this.vscrollBar.style.height&&(this.vscrollBar.style.height=
c);a=this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.elementInfo.maxTop+a.y)/this.elementInfo.maxTop*(this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height));a>this.elementInfo.bottomMargin&&(a=this.elementInfo.bottomMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.vscrollBar,{x:0,y:a},b,h);return!0};d.prototype.setHScrollBar=function(a,b,c){if(!this.elementInfo.requiresHScrollBar)return!1;var d=parseFloat(this.elementInfo.rightMargin/this.elementInfo.divWidth)*
this.elementInfo.rightMargin+"px";d!==this.hscrollBar.style.width&&(this.hscrollBar.style.width=d);a=this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width)-(this.elementInfo.maxLeft+a.x)/this.elementInfo.maxLeft*(this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width));a>this.elementInfo.rightMargin&&(a=this.elementInfo.rightMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.hscrollBar,{x:a,y:0},b,c);return!0};d.prototype.onTouchMove=function(a){if(null!==this.currentScrollingObject){var e=
this.calculateMovement(a);this.calculateTarget(e);this.lastScrollInfo=e;this.moved||(b.trigger(this,"scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),b.trigger(b.touchLayer,"scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),this.elementInfo.requiresVScrollBar&&(this.vscrollBar.style.display="block"),this.elementInfo.requiresHScrollBar&&(this.hscrollBar.style.display="block"));this.moved=!0;this.refresh&&0===e.top?(this.refreshContainer.style.display=
"block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight,this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh=!1):0>e.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow="hidden"));this.saveEventInfo(a);if(!1===this.isScrolling&&(this.isScrolling=!0,this.onScrollStart))this.onScrollStart();a=this.getCSSMatrix(this.el);this.lastScrollInfo.top=numOnly(a.f);this.lastScrollInfo.left=
numOnly(a.e);this.recalculateDeltaY(this.lastScrollInfo);this.recalculateDeltaX(this.lastScrollInfo);this.checkYboundary(this.lastScrollInfo);this.elementInfo.hasHorScroll&&this.checkXboundary(this.lastScrollInfo);a=0<this.lastScrollInfo.y&&0<this.lastScrollInfo.deltaY;var c=this.lastScrollInfo.y<-this.elementInfo.maxTop&&0>this.lastScrollInfo.deltaY,d;if(a||c)e=a?this.lastScrollInfo.y:-this.lastScrollInfo.y-this.elementInfo.maxTop,e=(this.container.clientHeight-e)/this.container.clientHeight,0.5>
e&&(e=0.5),d=0,a&&0<this.lastScrollInfo.top||c&&this.lastScrollInfo.top<-this.elementInfo.maxTop?d=this.lastScrollInfo.top:c&&(d=-this.elementInfo.maxTop),c=this.lastScrollInfo.deltaY*e,1>Math.abs(this.lastScrollInfo.deltaY*e)&&(c=a?1:-1),this.lastScrollInfo.y=d+c;if(this.elementInfo.hasHorScroll&&(a=0<this.lastScrollInfo.x&&0<this.lastScrollInfo.deltaX,c=this.lastScrollInfo.x<-this.elementInfo.maxLeft&&0>this.lastScrollInfo.deltaX,a||c))e=a?this.lastScrollInfo.x:-this.lastScrollInfo.x-this.elementInfo.maxLeft,
e=(this.container.clientWidth-e)/this.container.clientWidth,0.5>e&&(e=0.5),d=0,a&&0<this.lastScrollInfo.left||c&&this.lastScrollInfo.left<-this.elementInfo.maxLeft?d=this.lastScrollInfo.left:c&&(d=-this.elementInfo.maxLeft),c=this.lastScrollInfo.deltaX*e,1>Math.abs(this.lastScrollInfo.deltaX*e)&&(c=a?1:-1),this.lastScrollInfo.x=d+c;if(this.lockBounce||!this.refresh)0<this.lastScrollInfo.x?this.lastScrollInfo.x=0:-1*this.lastScrollInfo.x>this.elementInfo.maxLeft&&(this.lastScrollInfo.x=-1*this.elementInfo.maxLeft),
0<this.lastScrollInfo.y?this.lastScrollInfo.y=0:-1*this.lastScrollInfo.y>this.elementInfo.maxTop&&(this.lastScrollInfo.y=-1*this.elementInfo.maxTop);this.scrollerMoveCSS(this.lastScrollInfo,0);this.setVScrollBar(this.lastScrollInfo,0,0);this.setHScrollBar(this.lastScrollInfo,0,0);this.refresh&&!this.preventPullToRefresh&&(!this.refreshTriggered&&this.lastScrollInfo.top>this.refreshHeight?(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),b.trigger(this,"refresh-trigger")):this.refreshTriggered&&
this.lastScrollInfo.top<this.refreshHeight&&(this.refreshTriggered=!1,this.setRefreshContent("Pull to Refresh"),b.trigger(this,"refresh-cancel")));this.infinite&&!this.infiniteTriggered&&Math.abs(this.lastScrollInfo.top)>this.el.clientHeight-this.container.clientHeight&&(this.infiniteTriggered=!0,b.trigger(this,"infinite-scroll"))}};d.prototype.calculateMovement=function(a,b){var c={top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0},
d=b?this.firstEventInfo:this.lastEventInfo,g=b?a.pageX:a.touches[0].pageX,f=b?a.pageY:a.touches[0].pageY,l=b?a.time:a.timeStamp;c.deltaY=this.elementInfo.hasVertScroll?f-d.pageY:0;c.deltaX=this.elementInfo.hasHorScroll?g-d.pageX:0;c.time=l;c.duration=l-d.time;return c};d.prototype.calculateTarget=function(a){a.y=this.lastScrollInfo.y+a.deltaY;a.x=this.lastScrollInfo.x+a.deltaX;0<Math.abs(a.deltaY)&&(a.y+=(0<a.deltaY?1:-1)*this.elementInfo.divHeight*this.androidPerfHack);0<Math.abs(a.deltaX)&&(a.x+=
(0<a.deltaX?1:-1)*this.elementInfo.divWidth*this.androidPerfHack)};d.prototype.checkYboundary=function(a){var b=this.container.clientHeight/2,c=this.elementInfo.maxTop+b;if(a.y>b)a.y=b;else if(-a.y>c)a.y=-c;else return;this.recalculateDeltaY(a)};d.prototype.checkXboundary=function(a){var b=this.container.clientWidth/2,c=this.elementInfo.maxLeft+b;if(a.x>b)a.x=b;else if(-a.x>c)a.x=-c;else return;this.recalculateDeltaX(a)};d.prototype.recalculateDeltaY=function(a){var b=Math.abs(a.deltaY);a.deltaY=
a.y-a.top;var c=Math.abs(a.deltaY);a.duration=a.duration*c/b};d.prototype.recalculateDeltaX=function(a){var b=Math.abs(a.deltaX);a.deltaX=a.x-a.left;var c=Math.abs(a.deltaX);a.duration=a.duration*c/b};d.prototype.hideRefresh=function(a){var e=this;if(!this.preventHideRefresh){var c=function(){e.setRefreshContent("Pull to Refresh");b.trigger(e,"refresh-finish")};this.scrollerMoveCSS({x:0,y:0},325);!1===a||!e.afEl.css3Animate?c():e.afEl.css3Animate({time:"325ms",complete:c});this.refreshTriggered=!1}};
d.prototype.setMomentum=function(a){a.speedY=this.divide(a.deltaY,a.duration);a.speedX=this.divide(a.deltaX,a.duration);a.absSpeedY=Math.abs(a.speedY);a.absSpeedX=Math.abs(a.speedX);a.absDeltaY=Math.abs(a.deltaY);a.absDeltaX=Math.abs(a.deltaX);if(0<a.absDeltaY){if(a.deltaY+=(0>a.deltaY?-1:1)*a.absSpeedY*a.absSpeedY/0.0016,a.absDeltaY=Math.abs(a.deltaY),a.duration=a.absSpeedY/8E-4,a.speedY=a.deltaY/a.duration,a.absSpeedY=Math.abs(a.speedY),0.08>a.absSpeedY||5>a.absDeltaY)a.deltaY=a.absDeltaY=a.duration=
a.speedY=a.absSpeedY=0}else if(a.absDeltaX){if(a.deltaX+=(0>a.deltaX?-1:1)*a.absSpeedX*a.absSpeedX/0.0016,a.absDeltaX=Math.abs(a.deltaX),a.duration=a.absSpeedX/8E-4,a.speedX=a.deltaX/a.duration,a.absSpeedX=Math.abs(a.speedX),0.08>a.absSpeedX||5>a.absDeltaX)a.deltaX=a.absDeltaX=a.duration=a.speedX=a.absSpeedX=0}else a.duration=0};d.prototype.onTouchEnd=function(a){if(null!==this.currentScrollingObject&&this.moved){this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;
a=this.calculateMovement(this.lastEventInfo,!0);this.androidFormsMode||this.setMomentum(a);this.calculateTarget(a);var e=this.getCSSMatrix(this.el);a.top=numOnly(e.f);a.left=numOnly(e.e);this.checkYboundary(a);this.elementInfo.hasHorScroll&&this.checkXboundary(a);e=!this.preventPullToRefresh&&(a.top>this.refreshHeight||a.y>this.refreshHeight);this.fireRefreshRelease(e,0<a.top);if(this.refresh&&e)a.y=this.refreshHeight,a.duration=325;else if(0<=a.y)a.y=0,0<=a.top&&(a.duration=325);else if(-a.y>this.elementInfo.maxTop||
0===this.elementInfo.maxTop)a.y=-this.elementInfo.maxTop,-a.top>this.elementInfo.maxTop&&(a.duration=325);if(this.elementInfo.hasHorScroll)if(0<=a.x)a.x=0,0<=a.left&&this.refresh&&(a.duration=325);else if(-a.x>this.elementInfo.maxLeft||0===this.elementInfo.maxLeft)a.x=-this.elementInfo.maxLeft,-a.left>this.elementInfo.maxLeft&&this.refresh&&(a.duration=325);if(a.x===a.left&&a.y===a.top||this.androidFormsMode)a.duration=0;this.scrollerMoveCSS(a,a.duration,"cubic-bezier(0.33,0.66,0.66,1)");this.setVScrollBar(a,
a.duration,"cubic-bezier(0.33,0.66,0.66,1)");this.setHScrollBar(a,a.duration,"cubic-bezier(0.33,0.66,0.66,1)");this.setFinishCalback(a.duration);if(this.infinite&&!this.infiniteTriggered&&Math.abs(a.y)>=this.el.clientHeight-this.container.clientHeight){var c=this;setTimeout(function(){c.infiniteTriggered=!0;b.trigger(c,"infinite-scroll")},a.duration-50)}}};d.prototype.setFinishCalback=function(a){var e=this;this.scrollingFinishCB=setTimeout(function(){e.hideScrollbars();b.trigger(b.touchLayer,"scrollend",
[e.el]);b.trigger(e,"scrollend",[e.el]);e.isScrolling=!1;e.elementInfo=null;e.infinite&&e.infiniteTriggered&&b.trigger(e,"infinite-scroll-end")},a)};d.prototype.startFormsMode=function(){if(!this.blockFormsFix){var a=this.getCSSMatrix(this.el);this.refreshSafeKeep=this.refresh;this.refresh=!1;this.androidFormsMode=!0;this.el.style[b.feat.cssPrefix+"Transform"]="none";this.el.style[b.feat.cssPrefix+"Transition"]="none";this.el.style[b.feat.cssPrefix+"Perspective"]="none";this.scrollerMoveCSS({x:numOnly(a.e),
y:numOnly(a.f)},0);this.container.style[b.feat.cssPrefix+"Perspective"]="none";this.container.style[b.feat.cssPrefix+"BackfaceVisibility"]="visible";this.vscrollBar&&(this.vscrollBar.style[b.feat.cssPrefix+"Transform"]="none",this.vscrollBar.style[b.feat.cssPrefix+"Transition"]="none",this.vscrollBar.style[b.feat.cssPrefix+"Perspective"]="none",this.vscrollBar.style[b.feat.cssPrefix+"BackfaceVisibility"]="visible");this.hscrollBar&&(this.hscrollBar.style[b.feat.cssPrefix+"Transform"]="none",this.hscrollBar.style[b.feat.cssPrefix+
"Transition"]="none",this.hscrollBar.style[b.feat.cssPrefix+"Perspective"]="none",this.hscrollBar.style[b.feat.cssPrefix+"BackfaceVisibility"]="visible")}};d.prototype.stopFormsMode=function(){if(!this.blockFormsFix){var a=this.getCSSMatrix(this.el);this.refresh=this.refreshSafeKeep;this.androidFormsMode=!1;this.el.style[b.feat.cssPrefix+"Perspective"]=1E3;this.el.style.marginTop=0;this.el.style.marginLeft=0;this.el.style[b.feat.cssPrefix+"Transition"]="0ms linear";this.scrollerMoveCSS({x:numOnly(a.e),
y:numOnly(a.f)},0);this.container.style[b.feat.cssPrefix+"Perspective"]=1E3;this.container.style[b.feat.cssPrefix+"BackfaceVisibility"]="hidden";this.vscrollBar&&(this.vscrollBar.style[b.feat.cssPrefix+"Perspective"]=1E3,this.vscrollBar.style[b.feat.cssPrefix+"BackfaceVisibility"]="hidden");this.hscrollBar&&(this.hscrollBar.style[b.feat.cssPrefix+"Perspective"]=1E3,this.hscrollBar.style[b.feat.cssPrefix+"BackfaceVisibility"]="hidden")}};d.prototype.scrollerMoveCSS=function(a,e,c){e||(e=0);c||(c="linear");
e=numOnly(e);var d=this;this.el&&this.el.style&&(this.eventsActive&&(this.androidFormsMode?(this.el.style.marginTop=Math.round(a.y)+"px",this.el.style.marginLeft=Math.round(a.x)+"px"):(e={x:a.x,y:a.y,duration:e,easing:"easeOutSine"},d.initScrollProgress&&(e.update=function(a){b.trigger(d,"scroll",[a]);b.trigger(b.touchLayer,"scroll",[a])}),b(this.el).animate(e).start())),this.logPos(a.x,a.y))};d.prototype.logPos=function(a,b){var c;c=this.elementInfo?{h:this.elementInfo.bottomMargin,w:this.elementInfo.rightMargin}:
this.getViewportSize();this.loggedPcentX=this.divide(a,this.el.clientWidth-c.w);this.loggedPcentY=this.divide(b,this.el.clientHeight-c.h);this.scrollTop=b;this.scrollLeft=a};d.prototype.scrollbarMoveCSS=function(a,e,c,d){c||(c=0);a&&a.style&&(this.androidFormsMode?(a.style.marginTop=Math.round(e.y)+"px",a.style.marginLeft=Math.round(e.x)+"px"):b(a).animate({x:e.x,y:e.y,duration:c,easing:"easeOutSine"}).start())};d.prototype.scrollTo=function(a,b){b||(b=0);this.scrollerMoveCSS(a,b)};d.prototype.scrollBy=
function(a,b){var c=this.getCSSMatrix(this.el),d=numOnly(c.f),c=numOnly(c.e);this.scrollTo({y:d-a.y,x:c-a.x},b)};d.prototype.scrollToBottom=function(a){this.scrollTo({y:-1*(this.el.clientHeight-this.container.clientHeight),x:0},a)};d.prototype.scrollToTop=function(a){this.scrollTo({x:0,y:0},a)};return function(a,e){var c;if(!f&&b.touchLayer&&b.isObject(b.touchLayer))n();else if(!b.touchLayer||!b.isObject(b.touchLayer))b.touchLayer={};if(c="string"===typeof a||a instanceof String?document.getElementById(a):
a){var l=b(c);e.hasParent&&(l=l.parent());l.hasClass("x-scroll")&&(e.horizontalScroll=!0);l.hasClass("y-scroll")&&(e.verticalScroll=!0);return b.os.desktop?new g(c,e):e.useJsScroll?new d(c,e):new k(c,e)}window.alert("Could not find element for scroller "+a)}}()})(af);(function(b){function n(c,f,d){!0===d&&(this.getAttribute("multiple")||b.selectBox.updateMaskValue(this.parentNode.id,this.text,this.value),this.parentNode.value=this.value);return d}function m(c,f,d){this.options[d]&&(this.getAttribute("multiple")||b.selectBox.updateMaskValue(this.linker,this.options[d].value,this.options[d].text),this.value=this.options[d].value);return d}function f(c){var f=c.target;b(f.linker).remove();delete f.linker;c.stopPropagation()}b.selectBox={scroller:null,currLinker:null,
getOldSelects:function(c){if(b.os.android&&!b.os.androidICS)if(b.fn.scroller){var l=c&&document.getElementById(c)?document.getElementById(c):document;if(l){c=l.getElementsByTagName("select");for(l=0;l<c.length;l++){var d=c[l];d.style.display="none";var k=b.create("div",{className:"afFakeSelect"});k.get(0).linker=c[l];d.linker=k.get(0);k.insertAfter(c[l]);d.watch("selectedIndex",m);for(var g=0;g<d.options.length;g++)d.options[g].watch("selected",n),d.options[g].selected&&k.html(d.options[g].text);
b(d).one("destroy",f)}this.createHtml()}else window.alert("Could not find container element for af.selectBox "+c)}else window.alert("This library requires af.scroller")},updateDropdown:function(b){if(b)for(var f=0;f<b.options.length;f++)b.options[f].selected&&(b.linker.innerHTML=b.options[f].text)},initDropDown:function(c){if(!c.disabled&&c&&c.options&&0!==c.options.length){var f=0,d=b("#afSelectBoxfix");d.html("<ul></ul>");for(var d=d.find("ul"),k=0;k<c.options.length;k++){c.options[k].watch("selected",
n);var g=c.options[k].selected?"selected":"";g&&(f=k+1);g=b.create("li",{html:c.options[k].text,className:g});g.data("ind",k);d.append(g)}b("#afModalMask").show();try{if(0<f&&"multiple"!==c.getAttribute("multiple")){c=0;var a=numOnly(d.find("li").computedStyle("height")),e=numOnly(b("#afSelectBoxContainer").computedStyle("height"));f*a>=e&&(c=(f-1)*-a);this.scroller.scrollTo({x:0,y:c})}}catch(h){console.log("error init dropdown"+h)}f="block"===b("#afSelectClose").css("display")?numOnly(b("#afSelectClose").height()):
0;b("#afSelectWrapper").height(numOnly(b("#afSelectBoxContainer").height())-f+"px")}},updateMaskValue:function(c,f,d){b(c).html(d)},setDropDownValue:function(c,f){if(c){var d=b(c);f=parseInt(f,10);c.getAttribute("multiple")?(d=b("#afSelectBoxfix li:nth-child("+(f+1)+")"),d.hasClass("selected")?d.removeClass("selected"):d.addClass("selected")):(c.selectedIndex=f,d.find("option").prop("selected",!1),d.find("option:nth-child("+(f+1)+")").prop("selected",!0),this.scroller.scrollTo({x:0,y:0}),this.hideDropDown());
b(c).trigger("change")}},hideDropDown:function(){b("#afModalMask").hide();b("#afSelectBoxfix").html("")},createHtml:function(){var c=this;document.getElementById("afSelectBoxfix")||b(document).ready(function(){b(document).on("click",".afFakeSelect",function(a){this.linker.disabled||(c.currLinker=this,"multiple"===this.linker.getAttribute("multiple")?b("#afSelectClose").show():b("#afSelectClose").hide(),c.initDropDown(this.linker))});var f=b.create("div",{id:"afSelectBoxContainer"}),d=b.create("div",
{id:"afSelectBoxfix"}),k=b.create("div",{id:"afSelectWrapper"});k.css("position","relative");k.append(d);var d=b.create("div",{id:"afSelectClose",html:"<a id='afSelectDone'>Done</a> <a id='afSelectCancel'>Cancel</a>"}),g=b.create("div",{id:"afModalMask"}),a=b("#afui");f.prepend(d).append(k);g.append(f);0<a.length?a.append(g):document.body.appendChild(g.get(0));c.scroller=b.query("#afSelectBoxfix").scroller({scroller:!1,verticalScroll:!0,vScrollCSS:"afselectscrollBarV",hasParent:!0});b("#afModalMask").on("click",
function(a){0===b(a.target).closest("#afSelectBoxContainer").length&&c.hideDropDown()});b("#afSelectBoxfix").on("click","li",function(a){a=b(a.target);c.setDropDownValue(c.currLinker.linker,a.data("ind"))});b("#afSelectBoxContainer").on("click","a",function(a){if("afSelectCancel"===a.target.id)return c.hideDropDown();var d=b(c.currLinker.linker);d.find("option").prop("selected",!1);b("#afSelectBoxfix li").each(function(a){a=b(this);if(a.hasClass("selected")){var e=parseInt(a.data("ind"),10);d.find("option:nth-child("+
(e+1)+")").prop("selected",!0);c.currLinker.innerHTML=a.html()}});c.hideDropDown();a.stopPropagation();a.preventDefault();return!1})})}};HTMLElement.prototype.watch||(HTMLElement.prototype.watch=function(b,f){var d=this[b],k=d,g=function(){return k},a=function(a){d=k;return k=f.call(this,b,d,a)};delete this[b]&&(HTMLElement.defineProperty?HTMLElement.defineProperty(this,b,{get:g,set:a,enumerable:!1,configurable:!0}):HTMLElement.prototype.__defineGetter__&&HTMLElement.prototype.__defineSetter__&&(HTMLElement.prototype.__defineGetter__.call(this,
b,g),HTMLElement.prototype.__defineSetter__.call(this,b,a)))});HTMLElement.prototype.unwatch||(HTMLElement.prototype.unwatch=function(b){var f=this[b];delete this[b];this[b]=f})})(af);/*
 Intel
  simply include this plugin to allow sliding of your app to reveal the left and right hand menus.
*/
(function(b){var n,m,f,c,l=!1,d=!0;b.ui.slideSideMenu=!0;b.ui.fixedSideMenuWidth=2E4;var k=!1,g=!1;b.ui.ready(function(){if(!b.os.ie){var a=b("#content, #header, #navbar"),e=0,h=e/3,q=b.ui.transitionTime,r=0,t=!1,u=b.query("#menu"),v=b.query("#aside_menu"),w=u.width(),x=v.width(),z=["input","select","textarea"],y=!1;b("#afui").bind("touchstart",function(a){r=0;if(!b.ui.isSideMenuEnabled()&&!b.ui.isAsideMenuEnabled())return!0;if(!(1<a.touches.length)){var c=a.target.tagName.toLowerCase();c&&-1!==z.indexOf(c)||
(y=!0,w=u.width(),x=v.width(),n=a.touches[0].pageX,m=a.touches[0].pageY,k=g=d=l=!1,window.innerWidth>=b.ui.fixedSideMenuWidth?(d=!1,g=!0):d=!0,a=b.ui.getSideMenuPosition(),0<a?(r=1,e=w):0>a&&(r=2,e=x))}});b("#afui").bind("touchmove",function(s){if(!(1<s.touches.length)&&y){if(!b.ui.isSideMenuEnabled()&&!b.ui.isAsideMenuEnabled()||!b.ui.slideSideMenu||g)return!0;f=s.touches[0].pageX;c=s.touches[0].pageY;if(b.ui.splitview&&window.innerWidth>=parseInt(b.ui.handheldMinWidth,10)&&f>n&&0===r||!b.ui.isSideMenuEnabled()&&
f>n&&0===r||!b.ui.isAsideMenuEnabled()&&f<n&&0===r||Math.abs(c-m)>Math.abs(f-n))return!0;if(l)d=!0;else return l=!0,d=!1,!0;var p=f-n;0===r&&(0>p?(e=x,v.show(),b.ui.splitview||u.hide()):(e=w,u.show(),v.hide()));if(Math.abs(p)>e)return!0;h=e/3;t=Math.abs(p)<h?!1:2;1===r?(p+=e,t=Math.abs(p)<2*h?!1:2,p>e&&(p=e)):2===r?(p=-1*e+p,t=Math.abs(p)<2*h?!1:2,p<-1*e&&(p=-1*e)):0>p&&p<-1*e&&(p=-1*e);q=p/e*numOnly(b.ui.transitionTime);q=Math.abs(q);k=0>p?!0:!1;a.cssTranslate(p+"px,0");s.preventDefault();s.stopPropagation()}});
b("#afui").bind("touchend",function(a){if(!b.ui.isSideMenuEnabled()&&!b.ui.isAsideMenuEnabled())return!0;d&&(l&&!g)&&b.ui.toggleSideMenu(t,function(){},q,k);y=g=d=l=!1})}})})(af);(function(b){function n(b,c,a,e){var d=Math.abs(b-c),f=Math.abs(a-e);return d>=f?0<b-c?"Left":"Right":0<a-e?"Up":"Down"}function m(){f.last&&Date.now()-f.last>=l&&(f.el.trigger("longTap"),f={})}var f={},c,l=750,d;b(document).ready(function(){var k;b(document.body).bind("touchstart",function(g){g.originalEvent&&(g=g.originalEvent);if(g.touches&&0!==g.touches.length){var a=Date.now(),e=a-(f.last||a);g.touches&&0!==g.touches.length&&(f.el=b("tagName"in g.touches[0].target?g.touches[0].target:g.touches[0].target.parentNode),
c&&clearTimeout(c),f.x1=g.touches[0].pageX,f.y1=g.touches[0].pageY,f.x2=f.y2=0,0<e&&250>=e&&(f.isDoubleTap=!0),f.last=a,d=setTimeout(m,l),b.ui.useAutoPressed&&!f.el.data("ignore-pressed")&&f.el.addClass("pressed"),k&&(b.ui.useAutoPressed&&!k.data("ignore-pressed")&&k[0]!==f.el[0])&&k.removeClass("pressed"),k=f.el)}}).bind("touchmove",function(b){b.originalEvent&&(b=b.originalEvent);f.x2=b.touches[0].pageX;f.y2=b.touches[0].pageY;clearTimeout(d)}).bind("touchend",function(d){d.originalEvent&&(d=d.originalEvent);
f.el&&(b.ui.useAutoPressed&&!f.el.data("ignore-pressed")&&f.el.removeClass("pressed"),f.isDoubleTap?(f.el.trigger("doubleTap"),f={}):0<f.x2||0<f.y2?((30<Math.abs(f.x1-f.x2)||30<Math.abs(f.y1-f.y2))&&f.el.trigger("swipe")&&f.el.trigger("swipe"+n(f.x1,f.x2,f.y1,f.y2)),f.x1=f.x2=f.y1=f.y2=f.last=0):"last"in f&&(f.el.trigger("tap"),c=setTimeout(function(){c=null;f.el&&f.el.trigger("singleTap");f={}},250)))}).bind("touchcancel",function(){f.el&&(b.ui.useAutoPressed&&!f.el.data("ignore-pressed"))&&f.el.removeClass("pressed");
f={};clearTimeout(d)})});"swipe swipeLeft swipeRight swipeUp swipeDown doubleTap tap singleTap longTap".split(" ").forEach(function(c){b.fn[c]=function(b){return this.bind(c,b)}})})(af);(function(b){b.touchLayer=function(e){b.touchLayer=new a(e);return b.touchLayer};var n=["input","select","textarea"],m=["button","radio","checkbox","range","date"],f=b.os.ios,c=b.os.blackberry,l=b.os.blackberry||b.os.fennec||b.os.android&&!b.os.chrome,d=b.os.ios&&!b.os.ios7,k=!1,g=!1,a=function(a){this.clearTouchVars();a.addEventListener("touchstart",this,!1);a.addEventListener("touchmove",this,!1);a.addEventListener("touchend",this,!1);a.addEventListener("click",this,!1);a.addEventListener("focusin",
this,!1);document.addEventListener("scroll",this,!1);window.addEventListener("resize",this,!1);window.addEventListener("orientationchange",this,!1);this.layer=a;this.scrollEndedProxy_=b.proxy(this.scrollEnded,this);this.exitEditProxy_=b.proxy(this.exitExit,this,[]);this.launchFixUIProxy_=b.proxy(this.launchFixUI,this);var c=this;this.scrollTimeoutExpireProxy_=function(){c.scrollTimeout_=null;c.scrollTimeoutEl_.addEventListener("scroll",c.scrollEndedProxy_,!1)};this.retestAndFixUIProxy_=function(){b.os.android&&
!b.os.chrome&&(c.layer.style.height="100%");b.asap(c.testAndFixUI,c,arguments)};document.addEventListener("click",function(a){if(g)return a.preventDefault(),a.stopPropagation(),!1;void 0!==a.clientX&&null!==c.lastTouchStartX&&(2>Math.abs(c.lastTouchStartX-a.clientX)&&2>Math.abs(c.lastTouchStartY-a.clientY))&&(a.preventDefault(),a.stopPropagation())},!0);b.bind(this,"scrollstart",function(a){c.isScrolling=!0;c.scrollingEl_=a;b.feat.nativeTouchScroll||(c.scrollerIsScrolling=!0);c.fireEvent("UIEvents",
"scrollstart",a,!1,!1)});b.bind(this,"scrollend",function(a){c.isScrolling=!1;b.feat.nativeTouchScroll||(c.scrollerIsScrolling=!1);c.fireEvent("UIEvents","scrollend",a,!1,!1)});this.hideAddressBar(0,1);this.launchFixUI(5)};a.prototype={dX:0,dY:0,cX:0,cY:0,touchStartX:null,touchStartY:null,layer:null,scrollingEl_:null,scrollTimeoutEl_:null,scrollTimeout_:null,reshapeTimeout_:null,scrollEndedProxy_:null,exitEditProxy_:null,launchFixUIProxy_:null,reHideAddressBarTimeout_:null,retestAndFixUIProxy_:null,
panElementId:"header",blockClicks:!1,allowDocumentScroll_:!1,ignoreNextResize_:!1,blockPossibleClick_:!1,isScrolling:!1,isScrollingVertical_:!1,wasPanning_:!1,isPanning_:!1,isFocused_:!1,justBlurred_:!1,requiresNativeTap:!1,holdingReshapeType_:null,trackingClick:!1,scrollerIsScrolling:!1,handleEvent:function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchmove":this.onTouchMove(a);break;case "touchend":this.onTouchEnd(a);break;case "click":this.onClick(a);break;case "blur":this.onBlur(a);
break;case "scroll":this.onScroll(a);break;case "orientationchange":this.onOrientationChange(a);break;case "resize":this.onResize(a);break;case "focusin":this.onFocusIn(a)}},launchFixUI:function(a){a||(a=2);if(null===this.reHideAddressBarTimeout_)return this.testAndFixUI(0,a)},resetFixUI:function(){this.reHideAddressBarTimeout_&&clearTimeout(this.reHideAddressBarTimeout_);this.reHideAddressBarTimeout_=null},testAndFixUI:function(a,c){var d=this.getReferenceHeight(),f=this.getCurrentHeight();if(d!==
f&&!(0.97*f<d&&0.97*d<f))return this.hideAddressBar(a,c),!0;b.os.android&&this.resetFixUI();return!1},hideAddressBar:function(a,c){if(!b.ui||!b.ui.isIntel)if(a>=c)this.resetFixUI();else if(b.os.desktop||b.os.kindle)this.layer.style.height="100%";else if(b.os.android){window.scrollTo(1,1);this.layer.style.height=this.isFocused_||window.innerHeight>=window.outerHeight?window.innerHeight+"px":window.outerHeight+"px";var d=a+1;this.reHideAddressBarTimeout_=setTimeout(this.retestAndFixUIProxy_,250*d,d,
c)}else this.isFocused_||(document.documentElement.style.height="5000px",window.scrollTo(0,0),document.documentElement.style.height=window.innerHeight+"px",this.layer.style.height=window.innerHeight+"px")},getReferenceHeight:function(){return window.innerHeight},getCurrentHeight:function(){return b.os.android?window.innerHeight:numOnly(document.documentElement.style.height)},onOrientationChange:function(a){var c=this;a=!1;this.focusedElement&&(a=!0,this.focusedElement.blur());!this.holdingReshapeType_&&
this.reshapeTimeout_?this.fireReshapeEvent("orientationchange"):this.previewReshapeEvent("orientationchange");b.os.android&&b.os.chrome&&(this.layer.style.height="100%",setTimeout(function(){c.hideAddressBar(0,1)},a?600:0))},onResize:function(a){this.ignoreNextResize_?this.ignoreNextResize_=!1:this.launchFixUI()&&this.reshapeAction()},onClick:function(a){var c=a.target&&void 0!==a.target.tagName?a.target.tagName.toLowerCase():"";if(-1!==n.indexOf(c)&&(!this.isFocused_||a.target!==this.focusedElement)){c=
a.target&&void 0!==a.target.type?a.target.type.toLowerCase():"";if(-1===m.indexOf(c)){this.isFocused_&&this.focusedElement.removeEventListener("blur",this,!1);this.focusedElement=a.target;this.focusedElement.addEventListener("blur",this,!1);if(!this.isFocused_&&!this.justBlurred_)if(b.trigger(this,"enter-edit",[a.target]),b.os.ios){var d=this;setTimeout(function(){d.fireReshapeEvent("enter-edit")},300)}else this.previewReshapeEvent("enter-edit");this.isFocused_=!0}else this.isFocused_=!1;this.justBlurred_=
!1;this.allowDocumentScroll_=!0;f&&a.target.focus()}else b.os.blackberry10&&this.isFocused_&&this.focusedElement.blur()},previewReshapeEvent:function(a){var b=this;this.reshapeTimeout_=setTimeout(function(){b.fireReshapeEvent(a);b.reshapeTimeout_=null;b.holdingReshapeType_=null},750);this.holdingReshapeType_=a},fireReshapeEvent:function(a){b.trigger(this,"reshape");b.trigger(this,a?a+"-reshape":"unknown-reshape")},reshapeAction:function(){this.reshapeTimeout_?(clearTimeout(this.reshapeTimeout_),this.fireReshapeEvent(this.holdingReshapeType_),
this.reshapeTimeout_=this.holdingReshapeType_=null):this.previewReshapeEvent()},onFocusIn:function(a){if(!this.isFocused_)this.onClick(a)},onBlur:function(a){b.os.android&&a.target===window||(this.isFocused_=!1,this.focusedElement&&this.focusedElement.removeEventListener("blur",this,!1),this.focusedElement=null,this.justBlurred_=!0,b.asap(this.exitEditProxy_,this,[a.target]))},exitExit:function(a){this.justBlurred_=!1;if(!this.isFocused_)if(b.trigger(this,"exit-edit",[a]),this.allowDocumentScroll_=
!1,b.os.ios){var c=this;setTimeout(function(){c.fireReshapeEvent("exit-edit")},300)}else this.previewReshapeEvent("exit-edit")},onScroll:function(a){!this.allowDocumentScroll_&&(!this.isPanning_&&a.target===document)&&(this.allowDocumentScroll_=!0,this.wasPanning_?(this.wasPanning_=!1,setTimeout(this.launchFixUIProxy_,2E3,[2])):this.launchFixUI())},onTouchStart:function(a){this.dX=a.touches[0].pageX;this.dY=a.touches[0].pageY;this.lastTimestamp=a.timeStamp;this.lastTouchStartX=this.lastTouchStartY=
null;if(b.os.ios){if(k===a.touches[0].identifier)return g=!0,a.preventDefault(),k=!1;k=a.touches[0].identifier;g=!1}if(this.scrollerIsScrolling)return this.moved=!0,this.scrollerIsScrolling=!1,a.preventDefault(),!1;this.trackingClick=!0;(d||b.feat.nativeTouchScroll)&&this.checkDOMTree(a.target,this.layer);this.isScrolling&&(null!==this.scrollTimeout_?(clearTimeout(this.scrollTimeout_),this.scrollTimeout_=null,this.scrollTimeoutEl_!==this.scrollingEl_?this.scrollEnded(!1):this.blockPossibleClick_=
!0):this.scrollTimeoutEl_&&(this.scrollEnded(!0),this.blockPossibleClick_=!0));if(b.os.android&&a&&a.target&&a.target.getAttribute&&"ignore"===a.target.getAttribute("data-touchlayer")||this.isFocused_&&!b.os.blackberry10)this.allowDocumentScroll_=this.requiresNativeTap=!0;else if(l&&a.target&&void 0!==a.target.tagName){var c=a.target.tagName.toLowerCase();-1!==n.indexOf(c)&&(this.requiresNativeTap=!0)}else a.target&&(void 0!==a.target.tagName&&"input"===a.target.tagName.toLowerCase()&&"range"===a.target.type)&&
(this.requiresNativeTap=!0);b.os.chrome||(!this.isPanning_&&!this.requiresNativeTap?(this.isScrolling&&!b.feat.nativeTouchScroll||!this.isScrolling)&&a.preventDefault():this.isScrollingVertical_&&this.demandVerticalScroll())},demandVerticalScroll:function(){0>=this.scrollingEl_.scrollTop?this.scrollingEl_.scrollTop=1:this.scrollingEl_.scrollTop+this.scrollingEl_.clientHeight>=this.scrollingEl_.scrollHeight&&(this.scrollingEl_.scrollTop=this.scrollingEl_.scrollHeight-this.scrollingEl_.clientHeight-
1)},ignoreScrolling:function(a){return void 0===a.scrollWidth||void 0===a.clientWidth||void 0===a.scrollHeight||void 0===a.clientHeight?!0:!1},allowsVerticalScroll:function(a,b){var c=b.overflowY;return"scroll"===c||"auto"===c&&a.scrollHeight>a.clientHeight?!0:!1},allowsHorizontalScroll:function(a,b){var c=b.overflowX;return"scroll"===c||"auto"===c&&a.scrollWidth>a.clientWidth?!0:!1},checkDOMTree:function(a,c){if(d&&this.panElementId===a.id)this.isPanning_=!0;else{if(b.feat.nativeTouchScroll){if(this.ignoreScrolling(a))return;
var f=window.getComputedStyle(a);if(this.allowsVerticalScroll(a,f)){this.isScrollingVertical_=!0;this.scrollingEl_=a;this.isScrolling=!0;return}this.allowsHorizontalScroll(a,f)&&(this.isScrollingVertical_=!1,this.scrollingEl_=null,this.isScrolling=!0)}a!==c&&a.parentNode&&this.checkDOMTree(a.parentNode,c)}},scrollEnded:function(a){null!==this.scrollTimeoutEl_&&(a&&this.scrollTimeoutEl_.removeEventListener("scroll",this.scrollEndedProxy_,!1),this.fireEvent("UIEvents","scrollend",this.scrollTimeoutEl_,
!1,!1),this.scrollTimeoutEl_=null)},onTouchMove:function(a){var d=this.moved;this.moved=!0;c&&(this.cY=a.touches[0].pageY-this.dY,this.cX=a.touches[0].pageX-this.dX);this.isPanning_||(this.isScrolling&&(d||this.fireEvent("UIEvents","scrollstart",this.scrollingEl_,!1,!1),this.speedY=(this.lastY-a.touches[0].pageY)/(a.timeStamp-this.lastTimestamp),this.lastY=a.touches[0].pageY,this.lastX=a.touches[0].pageX,this.lastTimestamp=a.timeStamp),b.os.blackberry10||(!this.isScrolling||!b.feat.nativeTouchScroll)&&
a.preventDefault())},onTouchEnd:function(a){var d=this.moved;c&&(d=d&&!(10>Math.abs(this.cX)&&10>Math.abs(this.cY)));if(!b.os.ios||!this.requiresNativeTap)this.allowDocumentScroll_=!1;if(this.isPanning_&&d)this.wasPanning_=!0;else if(!d&&!this.requiresNativeTap){this.scrollerIsScrolling=!1;if(!this.trackingClick)return;a.preventDefault();if(!this.blockClicks&&!this.blockPossibleClick_){var d=a.target,f=a.changedTouches?a.changedTouches[0]:a.touches[0];3===d.nodeType&&(d=d.parentNode);this.fireEvent("Event",
"click",d,!0,a.mouseToTouch,f[0]);this.lastTouchStartX=this.dX;this.lastTouchStartY=this.dY}}else d&&(this.isScrolling&&(this.scrollTimeoutEl_=this.scrollingEl_,0.01>Math.abs(this.speedY)?this.scrollEnded(!1):this.scrollTimeout_=setTimeout(this.scrollTimeoutExpireProxy_,30)),this.requiresNativeTap&&(this.isFocused_||b.trigger(this,"cancel-enter-edit",[a.target])));b.os.blackberry10&&(this.lastTouchStartX=this.dX,this.lastTouchStartY=this.dY);this.clearTouchVars()},clearTouchVars:function(){this.speedY=
this.lastY=this.cY=this.cX=this.dX=this.dY=0;this.trackingClick=this.blockPossibleClick_=this.requiresNativeTap=this.isScrollingVertical_=this.isScrolling=this.isPanning_=this.moved=!1},fireEvent:function(a,c,d,f,g,k){var l=document.createEvent(a);l.initEvent(c,f,!0);k&&b.each(k,function(a,b){l.key=b});g&&(l.mouseToTouch=!0);d.dispatchEvent(l)}}})(af);
