This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
/
Copy pathbbui-min.js
7 lines (7 loc) · 216 KB
/
bbui-min.js
1
2
3
4
5
6
7
/*! bbUI for BB10 VERSION: 0.9.6.1894 | github.com/blackberry/bbUI.js/blob/master/LICENSE !*/bb={scroller:null,screens:[],dropdownScrollers:[],windowListeners:[],documentListeners:[],transparentPixel:"data:image/png;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",imageList:null,activityIndicator:null,fileInput:null,button:null,scrollPanel:null,bbmBubble:null,dropdown:null,textInput:null,roundPanel:null,grid:null,pillButtons:null,labelControlContainers:null,slider:null,radio:null,progress:null,checkbox:null,toggle:null,init:function(t){if(t)for(var e in t)bb.options[e]=t[e];bb.device.isRipple=navigator.userAgent.indexOf("Ripple")>=0||window.tinyHippos,bb.device.isPlayBook=navigator.userAgent.indexOf("PlayBook")>=0||1024==window.innerWidth&&600==window.innerHeight||600==window.innerWidth&&1024==window.innerHeight,bb.device.isBB10=!0,bb.device.requiresScrollingHack=navigator.userAgent.toLowerCase().indexOf("version/10.0")>=0||navigator.userAgent.toLowerCase().indexOf("version/10.1")>=0,bb.device.is10dot3=navigator.userAgent.toLowerCase().indexOf("version/10.3")>=0,bb.device.is10dot2=navigator.userAgent.toLowerCase().indexOf("version/10.2")>=0,bb.device.is10dot1=navigator.userAgent.toLowerCase().indexOf("version/10.1")>=0,bb.device.is10dot0=navigator.userAgent.toLowerCase().indexOf("version/10.0")>=0,bb.device.newerThan10dot0=bb.device.is10dot1||bb.device.is10dot2||bb.device.is10dot3,bb.device.newerThan10dot1=bb.device.is10dot2||bb.device.is10dot3,bb.device.newerThan10dot2=bb.device.is10dot3;var e,i=document.head.querySelectorAll("meta[name=viewport]");for(e=0;i.length>e;e++)try{document.head.removeChild(i[e])}catch(n){}var o=document.createElement("meta");o.setAttribute("name","viewport"),bb.device.is1024x600?o.setAttribute("content","initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi"):o.setAttribute("content","initial-scale="+1/window.devicePixelRatio+",user-scalable=no"),document.head.appendChild(o),bb.device.is1024x600=bb.device.isPlayBook,bb.device.is1280x768=1280==window.innerWidth&&768==window.innerHeight||768==window.innerWidth&&1280==window.innerHeight,bb.device.is720x720=720==window.innerWidth&&720==window.innerHeight,bb.device.is1280x720=1280==window.innerWidth&&720==window.innerHeight||720==window.innerWidth&&1280==window.innerHeight,bb.device.is1440x1440=1440==window.innerWidth&&1440==window.innerHeight;var r=parseInt(bb.cutHex(bb.options.highlightColor).substring(0,2),16),s=parseInt(bb.cutHex(bb.options.highlightColor).substring(2,4),16),a=parseInt(bb.cutHex(bb.options.highlightColor).substring(4,6),16);if(bb.options.shades={R:r,G:s,B:a,lightHighlight:"rgb("+(r+32)+", "+(s+32)+", "+(a+32)+")",darkHighlight:"rgb("+(r-120)+", "+(s-120)+", "+(a-120)+")",mediumHighlight:"rgb("+(r-60)+", "+(s-60)+", "+(a-60)+")",darkOutline:"rgb("+(r-32)+", "+(s-32)+", "+(a-32)+")",darkDarkHighlight:"rgb("+(r-140)+", "+(s-140)+", "+(a-140)+")"},document.styleSheets&&document.styleSheets.length)try{document.styleSheets[0].insertRule(".bb10Highlight {background-color:"+bb.options.highlightColor+";background-image:none;}",0),document.styleSheets[0].insertRule(".bbProgressHighlight {background-color:#92B43B;background-image:none;}",0),document.styleSheets[0].insertRule(".bb10-button-highlight {color:White;background-image: -webkit-gradient(linear, center top, center bottom, from("+bb.options.shades.darkHighlight+"), to("+bb.options.highlightColor+"));border-color:#53514F;}",0),document.styleSheets[0].insertRule(".pb-button-light-highlight {color:"+bb.options.shades.darkHighlight+";background-image: -webkit-gradient(linear, center top, center bottom, from("+bb.options.highlightColor+"), to("+bb.options.shades.darkHighlight+"));}",0),document.styleSheets[0].insertRule(".pb-button-dark-highlight {color:"+bb.options.highlightColor+";background-image: -webkit-gradient(linear, center top, center bottom, from("+bb.options.highlightColor+"), to("+bb.options.shades.darkHighlight+"));}",0),document.styleSheets[0].insertRule(".bb10Accent {background-color:"+bb.options.shades.darkHighlight+";}",0),document.styleSheets[0].insertRule(".bb10-title-colored {color:white;border-color: "+bb.options.shades.mediumHighlight+";text-shadow: 0px 2px black;background-image: -webkit-gradient(linear, center top, center bottom, from("+bb.options.highlightColor+"), to("+bb.options.shades.darkHighlight+"));}",0),document.styleSheets[0].insertRule(".bb10-title-button-container-colored {color:white;text-shadow: 0px 2px black;border-color: "+bb.options.shades.darkDarkHighlight+";background-color: "+bb.options.shades.darkHighlight+";}",0),document.styleSheets[0].insertRule(".bb10-title-button-colored {border-color: "+bb.options.shades.darkDarkHighlight+";background-image: -webkit-gradient(linear, center top, center bottom, from("+bb.options.highlightColor+"), to("+bb.options.shades.mediumHighlight+"));}",0),document.styleSheets[0].insertRule(".bb10-title-button-colored-highlight {border-color: "+bb.options.shades.darkDarkHighlight+";background-color: "+bb.options.shades.darkHighlight+";}",0),document.styleSheets[0].insertRule(".bb10-title-10dot3-colored {color:white;background-color: "+bb.options.highlightColor+";}",0),document.styleSheets[0].insertRule(".bb10-title-button-container-10dot3-colored {color:white;}",0),document.styleSheets[0].insertRule(".bb10-title-button-10dot3-colored {background: transparent; border-style: none; border-width: 0px; border-left-color: white; border-right-color: white;}",0),document.styleSheets[0].insertRule(".bb10-title-button-10dot3-colored-highlight {background-color: "+bb.options.shades.lightHighlight+";}",0)}catch(n){console.log(n.message)}bb.screen.controlColor=bb.options.controlsDark?"dark":"light",bb.screen.listColor=bb.options.listsDark?"dark":"light",bb.imageList=_bb10_imageList,bb.activityIndicator=_bb10_activityIndicator,bb.fileInput=_bb10_fileInput,bb.button=_bb10_button,bb.scrollPanel=_bb_PlayBook_10_scrollPanel,bb.bbmBubble=_bb_bbmBubble,bb.dropdown=_bb10_dropdown,bb.textInput=_bb10_textInput,bb.roundPanel=_bb10_roundPanel,bb.grid=_bb10_grid,bb.pillButtons=_bb10_pillButtons,bb.labelControlContainers=_bb10_labelControlContainers,bb.slider=_bb10_slider,bb.radio=_bb10_radio,bb.progress=_bb_progress,bb.checkbox=_bb10_checkbox,bb.toggle=_bb10_toggle,bb.contextMenu=bb.device.isPlayBook||bb.device.isRipple?_PlayBook_contextMenu:_bb10_contextMenu,bb.actionOverflow=_PlayBook_contextMenu,bb.device.isPlayBook||bb.device.isRipple||(blackberry.event.addEventListener("keyboardOpening",function(){bb.screen.currentScreen.actionBar&&bb.screen.currentScreen.actionBar.hide()}),blackberry.event.addEventListener("keyboardOpened",function(){bb.screen.currentScreen.actionBar&&bb.screen.focusedInput&&(bb.screen.focusedInput.container?bb.screen.focusedInput.container.scrollIntoView(!1):bb.screen.focusedInput.scrollIntoView(!1))}),blackberry.event.addEventListener("keyboardClosed",function(){bb.screen.currentScreen.actionBar&&bb.screen.currentScreen.actionBar.show()})),bb.device.isPlayBook||bb.device.isRipple||blackberry.ui&&blackberry.ui.contextmenu&&(blackberry.ui.contextmenu.enabled=!0,blackberry.bbui&&blackberry.bbui.initContext({highlightColor:bb.options.highlightColor}))},doLoad:function(t){var e=t||document.body;bb.screen.apply(e.querySelectorAll("[data-bb-type=screen]")),bb.style(e)},style:function(t){bb.scrollPanel&&bb.scrollPanel.apply(t.querySelectorAll("[data-bb-type=scroll-panel]")),bb.textInput&&bb.textInput.apply(t.querySelectorAll("input[type=text], [type=password], [type=tel], [type=url], [type=email], [type=number], [type=date], [type=time], [type=datetime], [type=month], [type=datetime-local], [type=color], [type=search]")),bb.dropdown&&bb.dropdown.apply(t.querySelectorAll("select")),bb.roundPanel&&bb.roundPanel.apply(t.querySelectorAll("[data-bb-type=round-panel]")),bb.imageList&&bb.imageList.apply(t.querySelectorAll("[data-bb-type=image-list]")),bb.grid&&bb.grid.apply(t.querySelectorAll("[data-bb-type=grid-layout]")),bb.bbmBubble&&bb.bbmBubble.apply(t.querySelectorAll("[data-bb-type=bbm-bubble]")),bb.pillButtons&&bb.pillButtons.apply(t.querySelectorAll("[data-bb-type=pill-buttons]")),bb.labelControlContainers&&bb.labelControlContainers.apply(t.querySelectorAll("[data-bb-type=label-control-container]")),bb.button&&bb.button.apply(t.querySelectorAll("[data-bb-type=button]")),bb.fileInput&&bb.fileInput.apply(t.querySelectorAll("input[type=file]")),bb.slider&&bb.slider.apply(t.querySelectorAll("input[type=range]")),bb.progress&&bb.progress.apply(t.querySelectorAll("progress")),bb.radio&&bb.radio.apply(t.querySelectorAll("input[type=radio]")),bb.activityIndicator&&bb.activityIndicator.apply(t.querySelectorAll("[data-bb-type=activity-indicator]")),bb.checkbox&&bb.checkbox.apply(t.querySelectorAll("input[type=checkbox]")),bb.toggle&&bb.toggle.apply(t.querySelectorAll("[data-bb-type=toggle]"))},getCurScreen:function(){return document.querySelector("[data-bb-type=screen]")},device:{isBB10:!1,isPlayBook:!1,isRipple:!1,requiresScrollingHack:!1,is1024x600:!1,is1280x768:!1,is720x720:!1,is1280x720:!1,is1440x1440:!1,is10dot3:!1,is10dot2:!1,is10dot1:!1,is10dot0:!1,newerThan10dot0:!1,newerThan10dot1:!1,newerThan10dot2:!1,newerThan10dot3:!1},options:{onscreenready:null,ondomready:null,controlsDark:!1,coloredTitleBar:!1,listsDark:!1,highlightColor:"#00A8DF"},loadScreen:function(t,e,i,n,o,r){var s,a=new XMLHttpRequest,l=document.createElement("div"),b=function(t,e,i){var n=i;return Array.prototype.forEach.apply(t,[function(t){n=e(n,t)}]),n},d=function(t,e){return"SCRIPT"===e.nodeName&&t.push(e),b(e.childNodes,d,t)},c=[],h=[];a.open("GET",t,!1),a.send(),l.setAttribute("id",n),l.innerHTML=a.responseText,c=b(l.childNodes,d,[]),l.scriptIds=[],r&&(r.scripts=[]),c.forEach(function(t){var e=document.createElement("script"),i=t.getAttribute("type");if(!i||"text/javascript"==i.toLowerCase()){var n=bb.guidGenerator();r?r.scripts.push({id:n,onunload:t.getAttribute("onunload")}):l.scriptIds.push({id:n,onunload:t.getAttribute("onunload")}),e.setAttribute("type","text/javascript"),t.text?(e.innerHTML=t.text,e.inline=!0):e.setAttribute("src",t.getAttribute("src")),e.setAttribute("id",n),h.push(e),t.parentNode.removeChild(t)}}),l.getElementById=function(t,e){var i=null;if(e||(e=this),e.getAttribute("id")==t)return e;for(var n=0;e.childNodes.length>n;n++){var o=e.childNodes[n];if(1==o.nodeType&&(i=this.getElementById(t,o)))break}return i},bb.screen.scriptCounter=0,bb.screen.totalScripts=h.length;for(var u,s=0;h.length>s;s++)u=h[s],document.body.appendChild(u),u.onload=function(){bb.screen.scriptCounter++,bb.screen.scriptCounter==bb.screen.totalScripts&&bb.initContainer(l,e,i,o)},1==u.inline&&setTimeout(u.onload,0);return 0===bb.screen.totalScripts&&setTimeout(function(){bb.initContainer(l,e,i,o)},0),l},initContainer:function(t,e,i,n){bb.options.onscreenready&&bb.options.onscreenready(t,e,n),bb.doLoad(t),document.body.appendChild(t);var o,r,s,a=t.querySelectorAll("[data-bb-type=screen]"),l=null;if(a.length>0){if(a=a[0],i){var b,d=bb.screens[bb.screens.length-1].container;o=d.querySelectorAll("[data-bb-type=screen]")[0],b=o.hasAttribute("data-bb-effect")?o.getAttribute("data-bb-effect"):void 0,b&&(a.style["z-index"]="-100","fade"==b.toLowerCase()?o.setAttribute("data-bb-effect","fade-out"):"slide-left"==b.toLowerCase()?o.setAttribute("data-bb-effect","slide-out-right"):"slide-right"==b.toLowerCase()?o.setAttribute("data-bb-effect","slide-out-left"):"slide-up"==b.toLowerCase()?o.setAttribute("data-bb-effect","slide-out-down"):"slide-down"==b.toLowerCase()&&o.setAttribute("data-bb-effect","slide-out-up"))}else o=a;if(o.popping=i,o.hasAttribute("data-bb-effect")&&(r=o.getAttribute("data-bb-effect"))){if(r=r.toLowerCase(),"fade"==r)l=bb.screen.fadeIn;else if("fade-out"==r)l=bb.screen.fadeOut;else switch(r){case"slide-left":l=bb.screen.slideLeft;break;case"slide-out-left":l=bb.screen.slideOutLeft;break;case"slide-right":l=bb.screen.slideRight;break;case"slide-out-right":l=bb.screen.slideOutRight;break;case"slide-up":l=bb.screen.slideUp;break;case"slide-out-up":l=bb.screen.slideOutUp;break;case"slide-down":l=bb.screen.slideDown;break;case"slide-out-down":l=bb.screen.slideOutDown}o.style.display="inline",l&&(s=document.createElement("div"),o.overlay=s,s.setAttribute("class","bb-transition-overlay"),document.body.appendChild(s),bb.screen.animating=!0,o.doEndAnimation=function(){var e=this.style;bb.screen.animating=!1,document.body.removeChild(this.overlay),this.overlay=null,bb.screens.length>1?this.popping?(this.style.display="none",this.parentNode.parentNode.removeChild(this.parentNode),bb.screens.pop(),a.style["z-index"]="",bb.screens[bb.screens.length-1].container=t):(bb.removePreviousScreenFromDom(),e.left="",e.right="",e.top="",e.bottom="",e.width="",e.height="",e["-webkit-animation-name"]="",e["-webkit-animation-duration"]="",e["-webkit-animation-timing-function"]="",e["-webkit-transform"]=""):1>=bb.screens.length&&(e.left="",e.right="",e.top="",e.bottom="",e.width="",e.height="",e["-webkit-animation-name"]="",e["-webkit-animation-duration"]="",e["-webkit-animation-timing-function"]="",e["-webkit-transform"]=""),this.removeEventListener("webkitAnimationEnd",this.doEndAnimation),bb.createScreenScroller(a)},o.doEndAnimation=o.doEndAnimation.bind(o),o.addEventListener("webkitAnimationEnd",o.doEndAnimation),l.call(this,o))}}if(bb.options.ondomready?(bb.domready.container=t,bb.domready.id=e,bb.domready.params=n,setTimeout(bb.domready.fire,1)):setTimeout(bb.domready.fireEventsOnly,1),!l){if(i){if(i){a.style["z-index"]="";var c=bb.screens[bb.screens.length-1].container;c.parentNode.removeChild(c),bb.screens.pop(),bb.screens[bb.screens.length-1].container=t}}else bb.screens.length>1&&bb.removePreviousScreenFromDom();bb.createScreenScroller(a)}},domready:{container:null,id:null,params:null,fire:function(){if(bb.screen.animating)return setTimeout(bb.domready.fire,250),void 0;var t=document.createEvent("Events");t.initEvent("bbuidomready",!0,!0),document.dispatchEvent(t),t=document.createEvent("Events"),t.initEvent("bbuilistready",!0,!0),document.dispatchEvent(t),bb.options.ondomready(bb.domready.container,bb.domready.id,bb.domready.params),bb.domready.container=null,bb.domready.id=null,bb.domready.params=null,t=document.createEvent("Events"),t.initEvent("bbuidomprocessed",!0,!0),document.dispatchEvent(t)},fireEventsOnly:function(){if(bb.screen.animating)return setTimeout(bb.domready.fireEventsOnly,250),void 0;var t=document.createEvent("Events");t.initEvent("bbuidomready",!0,!0),document.dispatchEvent(t),t=document.createEvent("Events"),t.initEvent("bbuilistready",!0,!0),document.dispatchEvent(t),t=document.createEvent("Events"),t.initEvent("bbuidomprocessed",!0,!0),document.dispatchEvent(t)}},createScreenScroller:function(t){var e=t.bbUIscrollWrapper;if(e)if(bb.device.isPlayBook){var i={hideScrollbar:!0,fadeScrollbar:!0,onBeforeScrollStart:function(t){var e=t.target;if(!e.parentNode||"bb-bb10-dropdown-items"!=e.parentNode.getAttribute("class")){for(;1!=e.nodeType;)e=e.parentNode;if("SELECT"!=e.tagName&&"INPUT"!=e.tagName&&"TEXTAREA"!=e.tagName&&"AUDIO"!=e.tagName&&"VIDEO"!=e.tagName){t.preventDefault();var i=document.activeElement;i&&("SELECT"==i.tagName||"INPUT"==i.tagName||"TEXTAREA"==i.tagName||"AUDIO"==i.tagName||"VIDEO"==i.tagName)&&i.blur()}}},onScrollEnd:function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)},onScrollMove:function(e){t.onscroll&&t.onscroll(e),evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)}};bb.scroller=new iScroll(e,i)}else bb.scroller=null,e.style["-webkit-overflow-scrolling"]="-blackberry-touch",e.onscroll=function(e){t.onscroll&&t.onscroll(e)}},clearScrollers:function(){for(var t,e=bb.dropdownScrollers-1;e>-1;e--)t=bb.dropdownScrollers[e],t.destroy(),t=null,bb.dropdownScrollers.pop()},removeTopMostScreenFromDom:function(){var t=bb.screens.length,e=document.getElementById(bb.screens[t-1].guid);document.body.removeChild(e)},removePreviousScreenFromDom:function(){var t,e,i=bb.screens.length;1!=i&&(e=i>1?2:1,t=document.getElementById(bb.screens[i-e].guid),t&&document.body.removeChild(t))},pushScreen:function(t,e,i){var n,o;for(bb.removeLoadedScripts(),n=0;bb.windowListeners.length>n;n++)o=bb.windowListeners[n],window.removeEventListener(o.name,o.eventHandler,!1);for(bb.windowListeners=[],n=0;bb.documentListeners.length>n;n++)o=bb.documentListeners[n],document.removeEventListener(o.name,o.eventHandler,!1);bb.documentListeners=[],bb.menuBar.clearMenu();var r=bb.screens.length;r>0&&(bb.screen.overlay=null,bb.screen.tabOverlay=null,bb.clearScrollers(),bb.screen.contextMenu&&(bb.screen.contextMenu=null));var s=bb.guidGenerator(),a=bb.loadScreen(t,e,!1,s,i);bb.screens.push({id:e,url:t,scripts:a.scriptIds,container:a,guid:s,params:i})},popScreen:function(){var t,e,i=bb.screens.length;if(i>1){for(bb.removeLoadedScripts(),bb.clearScrollers(),bb.menuBar.clearMenu(),bb.screen.overlay=null,bb.screen.tabOverlay=null,t=0;bb.windowListeners.length>t;t++)e=bb.windowListeners[t],window.removeEventListener(e.name,e.eventHandler,!1);for(bb.windowListeners=[],t=0;bb.documentListeners.length>t;t++)e=bb.documentListeners[t],document.removeEventListener(e.name,e.eventHandler,!1);bb.documentListeners=[];var n=bb.screens[i-2];bb.loadScreen(n.url,n.id,!0,n.guid,n.params,n)}else blackberry&&blackberry.app.exit()},removeLoadedScripts:function(){var numItems=bb.screens.length;if(numItems>0)for(var currentStackItem=bb.screens[numItems-1],current=document.getElementById(currentStackItem.guid),i=0;currentStackItem.scripts.length>i;i++){var bbScript=currentStackItem.scripts[i],scriptTag=document.getElementById(bbScript.id);bbScript.onunload&&eval(bbScript.onunload),scriptTag&&document.body.removeChild(scriptTag)}},innerHeight:function(){return bb.device.isPlayBook?window.orientation?0==window.orientation||180==window.orientation?600:-90==window.orientation||90==window.orientation?1024:void 0:window.innerHeight:window.innerHeight},innerWidth:function(){return bb.device.isPlayBook?window.orientation?0==window.orientation||180==window.orientation?1024:-90==window.orientation||90==window.orientation?600:void 0:window.innerWidth:window.innerWidth},getOrientation:function(){if(bb.device.is720x720)return"portrait";if(bb.device.isPlayBook){if(!window.orientation)return window.innerWidth>window.innerHeight?"landscape":"portrait";if(0==window.orientation||180==window.orientation)return"landscape";if(-90==window.orientation||90==window.orientation)return"portrait"}else{if(void 0==window.orientation)return window.innerWidth>window.innerHeight?"landscape":"portrait";if(0==window.orientation||180==window.orientation)return"portrait";if(-90==window.orientation||90==window.orientation)return"landscape"}},cutHex:function(t){return"#"==t.charAt(0)?t.substring(1,7):t},guidGenerator:function(){var t=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},refresh:function(){bb.scroller&&bb.scroller.refresh()},isScrolledIntoView:function(t){var e=0,i=t;if(i.offsetParent)do e+=i.offsetTop,i.scrollTop&&(e-=i.scrollTop),bb.device.isPlayBook&&(i.scroller?e+=i.scroller.y:i.bbUIscrollWrapper&&(e+=bb.scroller.y));while(i=i.offsetParent);return bb.innerHeight()>e}},Function.prototype.bind=function(t){var e=this;return function(){return e.apply(t,arguments)}},bb.actionBar={apply:function(t,e){var i,n,o,r,s,a,l,b=t.querySelectorAll("[data-bb-type=action]"),d=[],c=[],h=[],u=[],p=t,m=bb.getOrientation(),g=document.createElement("div"),v=document.createElement("div");for(t.isVisible=!0,t.setAttribute("class","bb-action-bar bb-action-bar-"+m+" bb-action-bar-dark"),t.mainBarTabs=h,t.mainBarButtons=d,t.overflowButtons=c,t.overflowTabs=u,t.dropShadow=document.createElement("div"),t.dropShadow.setAttribute("class","bb-action-bar-drop-shadow"),e.appendChild(t.dropShadow),t.oncontextmenu=function(t){var e=t.srcElement,i=e.parentNode;if(i)for(;i;){if(i==this){t.preventDefault();break}i=i.parentNode}},t.oncontextmenu=t.oncontextmenu.bind(t),window.addEventListener("contextmenu",t.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:t.oncontextmenu}),g.setAttribute("class","bb-action-bar-slide-label"),t.slideLabel=g,v.setAttribute("class","bb-action-bar-slide-label-text"),t.slideText=v,t.parentNode.appendChild(g),t.parentNode.appendChild(v),t.slideUpShown=!1,t.doLabelTimer=function(){this.slideUpShown=!0,this.slideLabel.style.height="48px",this.slideText.style.height="48px",this.slideText.style.visibility="visible"},t.doLabelTimer=t.doLabelTimer.bind(t),t.doTouchEnd=function(){this.timer&&clearTimeout(this.timer),this.slideUpShown&&(this.slideUpShown=!1,this.slideLabel.style.height="0px",this.slideText.style.visibility="hidden",this.slideText.style.height="0px")},t.doTouchEnd=t.doTouchEnd.bind(t),t.showLabel=function(t,e){if(bb.device.is720x720){var i=window.getComputedStyle(t);this.slideText.innerHTML=e,this.slideText.style.width=parseInt(i.width)+"px",this.slideText.style["margin-left"]=bb.actionBar.getBackBtnWidth(this.backBtn)+t.offsetLeft+"px",this.timer=setTimeout(this.doLabelTimer,1e3)}},t.showLabel=t.showLabel.bind(t),l=0;b.length>l;l++)i=b[l],i.hasAttribute("data-bb-style")&&(r=i.getAttribute("data-bb-style").toLowerCase(),"button"==r?i.hasAttribute("data-bb-overflow")&&"true"==i.getAttribute("data-bb-overflow").toLowerCase()?c.push(i):d.push(i):i.hasAttribute("data-bb-overflow")&&"true"==i.getAttribute("data-bb-overflow").toLowerCase()?u.push(i):h.push(i));if(t.hasAttribute("data-bb-back-caption")&&0==t.querySelectorAll("[data-bb-style=tab]").length){var f,y,w,E,x="bb-action-bar-back-button-dark";bb.device.is10dot2&&(x+="-10dot2"),s=document.createElement("div"),s.setAttribute("class","bb-action-bar-back-button "+x+" bb-action-bar-back-button-"+m),s.onclick=function(){window.setTimeout(bb.popScreen,0)},t.backBtn=s,f=document.createElement("div"),f.setAttribute("class","bb-action-bar-back-chevron-dark"),s.appendChild(f),y=document.createElement("div"),y.setAttribute("class","bb-action-bar-back-text bb-action-bar-back-text-"+m),y.innerHTML=t.getAttribute("data-bb-back-caption"),s.backCaption=y,s.appendChild(y),E=document.createElement("div"),E.setAttribute("class","bb-action-bar-back-button-highlight"),E.style.position="absolute",E.style.width=bb.device.is1024x600?"4px":"8px",E.style["background-color"]="transparent",s.updateHighlightDimensions=function(t){bb.device.is1024x600?(E.style.height="portrait"==t?"57px":"57px",E.style.top="8px"):bb.device.is720x720?(E.style.height="78px",E.style.top="15px"):bb.device.is1280x720?(E.style.height="portrait"==t?"84px":"70px",E.style.top="15px"):(E.style.height="portrait"==t?"110px":"70px",E.style.top="15px")},s.updateHighlightDimensions=s.updateHighlightDimensions.bind(s),s.backHighlight=E,s.updateHighlightDimensions(m),s.appendChild(E),s.ontouchstart=function(){this.backHighlight.style["background-color"]=bb.options.highlightColor},s.ontouchend=function(){this.backHighlight.style["background-color"]="transparent"},w=document.createElement("div"),x="bb-action-bar-back-slash-dark",bb.device.is10dot2&&(x+="-10dot2"),w.setAttribute("class",x+" bb-action-bar-back-slash-"+m),s.backslash=w;var C=document.createElement("table"),k=document.createElement("tr"),B=document.createElement("td");for(t.appendChild(C),C.appendChild(k),C.setAttribute("class","bb-action-bar-table"),B.style.width=bb.device.is1024x600?bb.actionBar.getBackBtnWidth(s)-16+"px":bb.actionBar.getBackBtnWidth(s)-33+"px",k.appendChild(B),s.innerChevron=B,B.appendChild(s),B=document.createElement("td"),B.style.width=bb.device.is1024x600?"16px":"33px",w.style["background-color"]=bb.options.shades.darkOutline,k.appendChild(B),B.appendChild(w),B=document.createElement("td"),B.style.width="100%",k.appendChild(B),p=B,l=0;b.length>l;l++)i=b[l],B.appendChild(i)}if(u.length>0&&(t.tabOverflowMenu=bb.tabOverflow.create(e),t.tabOverflowMenu.actionBar=t,i=document.createElement("div"),i.actionBar=t,i.tabOverflowMenu=t.tabOverflowMenu,i.setAttribute("data-bb-type","action"),i.setAttribute("data-bb-style","tab"),i.setAttribute("data-bb-img","overflow"),i.onclick=function(){this.tabOverflowMenu.show()},t.tabOverflowBtn=i,p.insertBefore(i,p.firstChild)),c.length>0&&(t.menu=bb.actionOverflow.create(e),t.appendChild(t.menu),t.moreCaption=t.hasAttribute("data-bb-more-caption")?t.getAttribute("data-bb-more-caption"):"More",i=document.createElement("div"),i.menu=t.menu,i.menu.actionBar=t,i.setAttribute("data-bb-type","action"),i.setAttribute("data-bb-style","button"),i.setAttribute("data-bb-img","overflow"),i.onclick=function(){this.menu.show()},t.actionOverflowBtn=i,p.appendChild(i)),t.getUsableWidth=function(){return bb.innerWidth()-bb.actionBar.getBackBtnWidth(this.backBtn)-bb.actionBar.getActionOverflowBtnWidth(this.actionOverflowBtn)-bb.actionBar.getTabOverflowBtnWidth(this.tabOverflowBtn)},t.getUsableWidth=t.getUsableWidth.bind(t),t.switchOrientationCSS=function(t){if(t){var e=bb.getOrientation();t="portrait"==e?t.replace("landscape","portrait"):t.replace("portrait","landscape")}return t},t.switchOrientationCSS=t.switchOrientationCSS.bind(t),t.reLayoutActionBar=function(){var e,i,n,o,r="button",s=0,a=5,l=0,b=0,d=0,c=bb.getOrientation();for(this.dropShadow.style.bottom=bb.screen.getActionBarHeight()-1+"px",this.dropShadow.style.display=t.isVisible?"block":"",this.actionOverflowBtn&&a--,this.backBtn&&a--,this.tabOverflowBtn&&(a--,this.tabOverflowBtn.dropShadow.style.display="",this.tabOverflowBtn.dropShadow.style.height=bb.screen.getActionBarHeight()+"px"),e=0;this.mainBarTabs.length>e&&l!=a;e++)n=this.mainBarTabs[e],1==n.visible&&l++;for(e=0;this.mainBarButtons.length>e&&l!=a;e++)i=this.mainBarButtons[e],1==i.visible&&l++;for(l=0==l?1:l,s=Math.floor(this.getUsableWidth()/l),o=this.getAttribute("class"),o=this.switchOrientationCSS(o),this.setAttribute("class",o),this.isVisible&&(bb.screen.currentScreen.outerScrollArea.style.bottom=bb.screen.getActionBarHeight()+"px",bb.scroller&&bb.scroller.refresh()),this.backBtn&&(o=this.backBtn.getAttribute("class"),o=this.switchOrientationCSS(o),this.backBtn.setAttribute("class",o),this.backBtn.updateHighlightDimensions(c),o=this.backBtn.backCaption.getAttribute("class"),o=this.switchOrientationCSS(o),this.backBtn.backCaption.setAttribute("class",o),o=this.backBtn.backslash.getAttribute("class"),o=this.switchOrientationCSS(o),this.backBtn.backslash.setAttribute("class",o),this.backBtn.innerChevron.style.width=bb.device.is1024x600?bb.actionBar.getBackBtnWidth(this.backBtn)-16+"px":bb.actionBar.getBackBtnWidth(this.backBtn)-33+"px"),l=0,d=s-2,e=0;this.mainBarTabs.length>e;e++)n=this.mainBarTabs[e],a>l&&1==n.visible?(b+=d+2,n.style.width=d+"px",n.normal=this.switchOrientationCSS(n.normal),n.highlight=this.switchOrientationCSS(n.highlight),o=n.tabInner.getAttribute("class"),o=this.switchOrientationCSS(o),n.tabInner.setAttribute("class",o),o=n.display.getAttribute("class"),o=this.switchOrientationCSS(o),n.display.setAttribute("class",o),r="tab",l++):(n.style.display="none",n.visible=!1);for(d=s-1,e=0;this.mainBarButtons.length>e;e++)i=this.mainBarButtons[e],a>l&&1==i.visible?(b+=d+1,i.style.width=d+"px",i.highlight.style.width=.6*s+"px",i.highlight.style["margin-left"]=.2*s+"px",i.normal="tab"==r?"bb-action-bar-action bb-action-bar-action-"+c+" bb-action-bar-button-dark bb-action-bar-button-tab-left-dark":"bb-action-bar-action bb-action-bar-action-"+c+" bb-action-bar-button-dark",i.setAttribute("class",i.normal),i.normal=this.switchOrientationCSS(i.normal),o=i.getAttribute("class"),o=this.switchOrientationCSS(o),i.setAttribute("class",o),r="button",l++):(i.style.display="none",i.visible=!1);if(this.tabOverflowBtn){var h=bb.actionBar.getTabOverflowBtnWidth(this.tabOverflowBtn)-1;b+=h+2,this.tabOverflowBtn.style.width=h+"px",this.tabOverflowBtn.normal=this.switchOrientationCSS(this.tabOverflowBtn.normal),this.tabOverflowBtn.highlight=this.switchOrientationCSS(this.tabOverflowBtn.highlight),o=this.tabOverflowBtn.getAttribute("class"),o=this.switchOrientationCSS(o),this.tabOverflowBtn.setAttribute("class",o),o=this.tabOverflowBtn.tabHighlight.getAttribute("class"),o=this.switchOrientationCSS(o),this.tabOverflowBtn.tabHighlight.setAttribute("class",o),o=this.tabOverflowBtn.display.getAttribute("class"),o=this.switchOrientationCSS(o),this.tabOverflowBtn.display.setAttribute("class",o),this.tabOverflowBtn.icon.normal=this.switchOrientationCSS(this.tabOverflowBtn.icon.normal),o=this.tabOverflowBtn.icon.getAttribute("class"),o=this.switchOrientationCSS(o),this.tabOverflowBtn.icon.setAttribute("class",o),0==this.mainBarTabs.length&&0==this.mainBarButtons&&(this.tabOverflowBtn.dropShadow.style.display="block")}this.actionOverflowBtn&&("tab"==r?(this.actionOverflowBtn.normal="bb-action-bar-action bb-action-bar-action-"+c+" bb-action-bar-button-dark bb-action-bar-button-tab-left-dark",this.actionOverflowBtn.style.width=bb.innerWidth()-b+"px"):(this.actionOverflowBtn.normal="bb-action-bar-action bb-action-bar-action-"+c+" bb-action-bar-button-dark",this.actionOverflowBtn.style.width=bb.actionBar.getActionOverflowBtnWidth(this.actionOverflowBtn)-1+"px"),this.actionOverflowBtn.highlight.style.width=.6*bb.actionBar.getActionOverflowBtnWidth(this.actionOverflowBtn)+"px",this.actionOverflowBtn.highlight.style["margin-left"]=.2*bb.actionBar.getActionOverflowBtnWidth(this.actionOverflowBtn)+"px",this.actionOverflowBtn.style.float="right",this.actionOverflowBtn.setAttribute("class",this.actionOverflowBtn.normal),this.actionOverflowBtn.normal=this.switchOrientationCSS(this.actionOverflowBtn.normal),o=this.actionOverflowBtn.getAttribute("class"),o=this.switchOrientationCSS(o),this.actionOverflowBtn.setAttribute("class",o),o=this.actionOverflowBtn.icon.getAttribute("class"),o=this.switchOrientationCSS(o),this.actionOverflowBtn.icon.setAttribute("class",o))},t.reLayoutActionBar=t.reLayoutActionBar.bind(t),window.addEventListener("orientationchange",t.reLayoutActionBar,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:t.reLayoutActionBar}),t.setBackCaption=function(t){this.setAttribute("data-bb-back-caption",t),y.innerHTML=t},t.setBackCaption=t.setBackCaption.bind(t),t.setSelectedTab=function(t){"tab"==t.getAttribute("data-bb-style")&&(bb.actionBar.highlightAction(t),t.onclick&&t.onclick())},t.setSelectedTab=t.setSelectedTab.bind(t),t.hide=function(){this.isVisible&&(this.style.display="none",this.dropShadow.style.display="none",this.slideLabel.style.display="none",bb.screen.currentScreen.outerScrollArea.style.bottom="0px",this.isVisible=!1,bb.scroller&&bb.scroller.refresh())},t.hide=t.hide.bind(t),t.show=function(){this.isVisible||(this.style.display="",this.dropShadow.style.display="block",this.slideLabel.style.display="",bb.screen.currentScreen.outerScrollArea.style.bottom=bb.screen.getActionBarHeight()+"px",this.isVisible=!0,bb.scroller&&bb.scroller.refresh())},t.show=t.show.bind(t),u.length>0){var A;for(l=0;h.length>l;l++)i=h[l],"overflow"!=i.getAttribute("data-bb-img")&&(A=i.cloneNode(!0),A.visibleTab=i,A.actionBar=t,t.tabOverflowMenu.add(A));for(l=0;u.length>l;l++)i=u[l],i.actionBar=t,t.tabOverflowMenu.add(i)}for(l=0;c.length>l;l++)i=c[l],t.menu.add(i);var T,S;for(l=0;h.length>l;l++)T=h[l],n=T.innerHTML,T.actionBar=t,T.visible=!0,T.innerHTML="",S=document.createElement("div"),T.tabInner=S,T.appendChild(S),T.setAttribute("class","bb-action-bar-tab-outer"),T.normal="bb-action-bar-action bb-action-bar-action-"+m+" bb-action-bar-tab-dark bb-action-bar-tab-normal-dark",T.highlight=T.normal+" bb-action-bar-tab-selected-dark",S.setAttribute("class",T.normal),T.visible=!0,T.hasAttribute("data-bb-visible")&&"false"==T.getAttribute("data-bb-visible").toLowerCase()&&(T.visible=!1),a=document.createElement("img"),a.setAttribute("class","bb-action-bar-icon"),a.setAttribute("src",T.getAttribute("data-bb-img")),T.icon=a,S.appendChild(a),o=document.createElement("div"),o.setAttribute("class","bb-action-bar-action-display bb-action-bar-action-display-"+m),o.innerHTML=n,T.display=o,S.appendChild(o),T.hasAttribute("data-bb-selected")&&"true"==T.getAttribute("data-bb-selected").toLowerCase()&&bb.actionBar.highlightAction(T),T.addEventListener("click",function(){bb.actionBar.highlightAction(this)
},!1),T.setCaption=function(t){if(this.display.innerHTML=t,this.actionBar.tabOverflowMenu){var e,i,n=this.actionBar.tabOverflowMenu.actions;for(e=0;n.length>e;e++)i=n[e],i.visibleTab==this&&i.setCaption(t)}},T.setCaption=T.setCaption.bind(T),T.getCaption=function(){return this.display.innerHTML},T.getCaption=T.getCaption.bind(T),T.setImage=function(t){if(this.icon.setAttribute("src",t),this.actionBar.tabOverflowMenu){var e,i,n=this.actionBar.tabOverflowMenu.actions;for(e=0;n.length>e;e++)i=n[e],i.visibleTab==this&&i.setImage(t)}},T.setImage=T.setImage.bind(T),T.getImage=function(){return this.icon.getAttribute("src")},T.getImage=T.getImage.bind(T),T.hide=bb.actionBar.actionHide,T.hide=T.hide.bind(T),T.show=bb.actionBar.actionShow,T.show=T.show.bind(T),T.ontouchstart=function(){this.actionBar.showLabel(this,this.display.innerHTML)},T.ontouchend=function(){this.actionBar.doTouchEnd()};var O;t.tabOverflowBtn&&(O=t.tabOverflowBtn,n=O.innerHTML,O.actionBar=t,O.visible=!0,O.innerHTML="",S=document.createElement("div"),O.tabInner=S,O.appendChild(S),O.setAttribute("class","bb-action-bar-tab-outer"),O.normal="bb-action-bar-action bb-action-bar-action-"+m+" bb-action-bar-tab-dark bb-action-bar-tab-normal-dark",O.highlight=O.normal+" bb-action-bar-tab-selected-dark",S.setAttribute("class",O.normal),O.dropShadow=document.createElement("div"),O.dropShadow.setAttribute("class","bb-action-bar-button-tab-left-dark bb-action-bar-button-tab-overflow-only-shadow"),O.parentNode.appendChild(O.dropShadow),a=document.createElement("img"),a.setAttribute("class","bb-action-bar-icon"),a.setAttribute("src",bb.transparentPixel),a.normal="bb-action-bar-icon bb-action-bar-tab-overflow-dark bb-action-bar-tab-overflow-"+m,a.highlight="bb-action-bar-icon",a.setAttribute("class",a.normal),S.appendChild(a),o=document.createElement("div"),o.setAttribute("class","bb-action-bar-action-display bb-action-bar-action-display-"+m),o.innerHTML=n,O.display=o,S.appendChild(o),O.icon=a,o.innerHTML=" ",O.display=o,O.tabHighlight=document.createElement("div"),O.tabHighlight.setAttribute("class","bb-action-bar-tab-overflow-dark bb-action-bar-tab-overflow-highlight bb-action-bar-tab-overflow-highlight-"+m),S.appendChild(O.tabHighlight),O.style.width=bb.actionBar.getTabOverflowBtnWidth(O)-1+"px",O.reset=function(){this.icon.setAttribute("src",bb.transparentPixel),this.icon.setAttribute("class",this.icon.normal),this.tabHighlight.style.display="none",this.display.innerHTML=" "},O.reset=O.reset.bind(O),O.ontouchstart=function(){var t=""==this.display.innerHTML||" "==this.display.innerHTML?this.actionBar.moreCaption:this.display.innerHTML;this.actionBar.showLabel(this,t)},O.ontouchend=function(){this.actionBar.doTouchEnd()});var L;for(l=0;d.length>l;l++)L=d[l],L.actionBar=t,n=L.innerHTML,a=document.createElement("img"),a.setAttribute("src",L.getAttribute("data-bb-img")),a.setAttribute("class","bb-action-bar-icon"),L.normal="bb-action-bar-action bb-action-bar-action-"+m+" bb-action-bar-button-dark",L.visible=!0,L.hasAttribute("data-bb-visible")&&"false"==L.getAttribute("data-bb-visible").toLowerCase()&&(L.visible=!1),L.icon=a,L.innerHTML="",L.setAttribute("class",L.normal),L.appendChild(a),o=document.createElement("div"),o.setAttribute("class","bb-action-bar-action-display"),o.innerHTML=n,L.display=o,L.appendChild(o),L.highlight=document.createElement("div"),L.highlight.setAttribute("class","bb-action-bar-action-highlight"),L.highlight.style.height=bb.device.is1024x600?"4px":"8px",L.highlight.style["background-color"]="transparent",L.appendChild(L.highlight),L.setCaption=function(t){this.display.innerHTML=t},L.setCaption=L.setCaption.bind(L),L.getCaption=function(){return this.display.innerHTML},L.getCaption=L.getCaption.bind(L),L.setImage=function(t){this.icon.setAttribute("src",t)},L.setImage=L.setImage.bind(L),L.getImage=function(){return this.icon.getAttribute("src")},L.getImage=L.getImage.bind(L),L.hide=bb.actionBar.actionHide,L.hide=L.hide.bind(L),L.show=bb.actionBar.actionShow,L.show=L.show.bind(L),L.ontouchstart=function(){this.highlight.style["background-color"]=bb.options.highlightColor,this.actionBar.showLabel(this,this.display.innerHTML)},L.ontouchend=function(){this.highlight.style["background-color"]="transparent",this.actionBar.doTouchEnd()};if(t.actionOverflowBtn){actionOverflow=t.actionOverflowBtn,actionOverflow.actionBar=t,actionOverflow.visible=!0,n=actionOverflow.innerHTML,a=document.createElement("img"),a.setAttribute("src",bb.transparentPixel);var M;M=bb.device.is10dot2&&"portrait"==m.toLowerCase()?"portait-10dot2":m,a.setAttribute("class","bb-action-bar-icon bb-action-bar-overflow-button-dark bb-action-bar-overflow-button-"+M),actionOverflow.icon=a,actionOverflow.normal="bb-action-bar-action bb-action-bar-action-"+m+" bb-action-bar-button-dark",actionOverflow.innerHTML="",actionOverflow.setAttribute("class",actionOverflow.normal),actionOverflow.appendChild(a);var o=document.createElement("div");o.setAttribute("class","bb-action-bar-action-display"),o.innerHTML=bb.device.is10dot2?t.moreCaption:n,actionOverflow.display=o,actionOverflow.appendChild(o),actionOverflow.highlight=document.createElement("div"),actionOverflow.highlight.setAttribute("class","bb-action-bar-action-highlight"),actionOverflow.highlight.style.height=bb.device.is1024x600?"4px":"8px",actionOverflow.highlight.style["background-color"]="transparent",actionOverflow.appendChild(actionOverflow.highlight),actionOverflow.ontouchstart=function(){this.highlight.style["background-color"]=bb.options.highlightColor,this.actionBar.showLabel(this,this.actionBar.moreCaption)},actionOverflow.ontouchend=function(){this.highlight.style["background-color"]="transparent",this.actionBar.doTouchEnd()}}t.menu&&t.menu.centerMenuItems(),t.tabOverflowMenu&&(t.tabOverflowMenu.centerMenuItems(),t.tabOverflowMenu.initSelected()),t.reLayoutActionBar()},actionShow:function(){this.visible||(this.style.display="",this.visible=!0,this.actionBar.reLayoutActionBar())},actionHide:function(){this.visible&&(this.style.display="none",this.visible=!1,this.actionBar.reLayoutActionBar())},getTabOverflowBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is720x720?144:"portrait"==bb.getOrientation()?154:256:0},getActionOverflowBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is720x720?144:"portrait"==bb.getOrientation()?154:256:0},getBackBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?93:150:bb.device.is720x720?174:bb.device.is1280x720?"portrait"==bb.getOrientation()?179:300:"portrait"==bb.getOrientation()?187:300:0},highlightAction:function(t,e){var i,n,o=t.actionBar.mainBarTabs;for(i=0;o.length>i;i++)n=o[i],n!=t&&bb.actionBar.unhighlightAction(n);if(t.actionBar.tabOverflowMenu){for(o=t.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n!=e&&bb.actionBar.unhighlightAction(n);t.actionBar.tabOverflowBtn.tabInner&&(t.actionBar.tabOverflowBtn.tabInner.style["border-top-color"]="",t.actionBar.tabOverflowBtn.tabInner.setAttribute("class",t.actionBar.tabOverflowBtn.normal))}if(t.tabInner?(t.tabInner.style["border-top-color"]=bb.options.highlightColor,t.tabInner.setAttribute("class",t.highlight)):(t.style["border-top-color"]=bb.options.highlightColor,t.setAttribute("class",t.highlight)),t.selected=!0,e&&(e.setAttribute("class",e.normal+" bb10Highlight"),e.selected=!0),t.actionBar.tabOverflowMenu&&!e)if(t.actionBar.tabOverflowBtn&&t==t.actionBar.tabOverflowBtn)e.setAttribute("class",e.normal+" bb10Highlight");else for(o=t.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n.visibleTab==t&&n.setAttribute("class",n.normal+" bb10Highlight");t.actionBar.tabOverflowBtn&&t.actionBar.tabOverflowBtn.reset&&t.actionBar.tabOverflowBtn.reset()},unhighlightAction:function(t){var e;if(t.tabInner?(t.tabInner.style["border-top-color"]="",t.tabInner.setAttribute("class",t.normal)):(t.style["border-top-color"]="",t.setAttribute("class",t.normal)),t.actionBar&&t.actionBar.tabOverflowMenu)for(tabs=t.actionBar.tabOverflowMenu.actions,i=0;tabs.length>i;i++)e=tabs[i],e.tabInner?e.tabInner.setAttribute("class",e.normal):e.setAttribute("class",e.normal),e.selected=!1}},bb.actionBar10dot3={apply:function(t,e){var i,n,o,r,s,a,l,b=t.querySelectorAll("[data-bb-type=action]"),d=[],c=[],h=[],u=[],p=t,m=bb.getOrientation(),g=document.createElement("div"),v=document.createElement("div");for(t.isVisible=!0,t.setAttribute("class","bb-action-bar-10dot3 bb-action-bar-10dot3-"+m+" bb-action-bar-10dot3-"+bb.screen.controlColor),t.mainBarTabs=h,t.mainBarButtons=d,t.overflowButtons=c,t.overflowTabs=u,t.oncontextmenu=function(t){var e=t.srcElement,i=e.parentNode;if(i)for(;i;){if(i==this){t.preventDefault();break}i=i.parentNode}},t.oncontextmenu=t.oncontextmenu.bind(t),window.addEventListener("contextmenu",t.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:t.oncontextmenu}),g.setAttribute("class","bb-action-bar-10dot3-slide-label"),t.slideLabel=g,v.setAttribute("class","bb-action-bar-10dot3-slide-label-text"),t.slideText=v,t.parentNode.appendChild(g),t.parentNode.appendChild(v),t.slideUpShown=!1,t.doLabelTimer=function(){this.slideUpShown=!0,this.slideLabel.style.height="48px",this.slideText.style.height="48px",this.slideText.style.visibility="visible"},t.doLabelTimer=t.doLabelTimer.bind(t),t.doTouchEnd=function(){this.timer&&clearTimeout(this.timer),this.slideUpShown&&(this.slideUpShown=!1,this.slideLabel.style.height="0px",this.slideText.style.visibility="hidden",this.slideText.style.height="0px")},t.doTouchEnd=t.doTouchEnd.bind(t),t.showLabel=function(t,e){if(bb.device.is720x720){var i=window.getComputedStyle(t);this.slideText.innerHTML=e,this.slideText.style.width=parseInt(i.width)+"px",this.slideText.style["margin-left"]=bb.actionBar10dot3.getBackBtnWidth(this.backBtn)+t.offsetLeft+"px",this.timer=setTimeout(this.doLabelTimer,1e3)}},t.showLabel=t.showLabel.bind(t),l=0;b.length>l;l++)i=b[l],i.hasAttribute("data-bb-style")&&(r=i.getAttribute("data-bb-style").toLowerCase(),"button"==r?i.hasAttribute("data-bb-overflow")&&"true"==i.getAttribute("data-bb-overflow").toLowerCase()?c.push(i):d.push(i):i.hasAttribute("data-bb-overflow")&&"true"==i.getAttribute("data-bb-overflow").toLowerCase()?u.push(i):h.push(i));if(t.hasAttribute("data-bb-back-caption")&&0==t.querySelectorAll("[data-bb-style=tab]").length){var f,y,w,E;s=document.createElement("div"),s.setAttribute("class","bb-action-bar-10dot3-back-button bb-action-bar-10dot3-back-button-"+m),s.onclick=function(){window.setTimeout(bb.popScreen,0)},t.backBtn=s,f=document.createElement("div"),f.setAttribute("class","bb-action-bar-10dot3-back-chevron-"+bb.screen.controlColor),s.appendChild(f),s.ontouchstart=function(){"light"==bb.screen.controlColor?(this.style["background-color"]="#DDDDDD",this.backslash.style["background-color"]="#DDDDDD"):(this.style["background-color"]="#3A3A3A",this.backslash.style["background-color"]="#3A3A3A")},s.ontouchend=function(){this.style["background-color"]="",this.backslash.style["background-color"]=""},y=document.createElement("div"),w="bb-action-bar-10dot3-back-slash-"+bb.screen.controlColor,y.setAttribute("class",w+" bb-action-bar-10dot3-back-slash-"+m),s.backslash=y,E=document.createElement("div"),E.setAttribute("class","bb-action-bar-10dot3-colored-slash"),E.style["background-color"]=bb.options.highlightColor,y.appendChild(E);var x=document.createElement("table"),C=document.createElement("tr"),k=document.createElement("td");for(t.appendChild(x),x.appendChild(C),x.setAttribute("class","bb-action-bar-10dot3-table"),k.style.width=bb.device.is1024x600?bb.actionBar10dot3.getBackBtnWidth(s)-16+"px":bb.actionBar10dot3.getBackBtnWidth(s)-33+"px",C.appendChild(k),s.innerChevron=k,k.appendChild(s),k=document.createElement("td"),k.style.width=bb.device.is1024x600?"16px":"33px",C.appendChild(k),k.appendChild(y),k=document.createElement("td"),k.style.width="100%",C.appendChild(k),p=k,l=0;b.length>l;l++)i=b[l],k.appendChild(i)}if(u.length>0&&(t.tabOverflowMenu=bb.tabOverflow.create(e),t.tabOverflowMenu.actionBar=t,i=document.createElement("div"),i.actionBar=t,i.tabOverflowMenu=t.tabOverflowMenu,i.setAttribute("data-bb-type","action"),i.setAttribute("data-bb-style","tab"),i.setAttribute("data-bb-img","overflow"),i.onclick=function(){this.tabOverflowMenu.show()},t.tabOverflowBtn=i,p.insertBefore(i,p.firstChild)),c.length>0&&(t.menu=bb.actionOverflow.create(e),t.appendChild(t.menu),t.moreCaption=t.hasAttribute("data-bb-more-caption")?t.getAttribute("data-bb-more-caption"):"More",i=document.createElement("div"),i.menu=t.menu,i.menu.actionBar=t,i.setAttribute("data-bb-type","action"),i.setAttribute("data-bb-style","button"),i.setAttribute("data-bb-img","overflow"),i.onclick=function(){this.menu.show()},t.actionOverflowBtn=i,p.appendChild(i)),t.getUsableWidth=function(){return bb.innerWidth()-bb.actionBar10dot3.getBackBtnWidth(this.backBtn)-bb.actionBar10dot3.getActionOverflowBtnWidth(this.actionOverflowBtn)-bb.actionBar10dot3.getTabOverflowBtnWidth(this.tabOverflowBtn)},t.getUsableWidth=t.getUsableWidth.bind(t),t.switchOrientationCSS=function(t){if(t){var e=bb.getOrientation();t="portrait"==e?t.replace("landscape","portrait"):t.replace("portrait","landscape")}return t},t.switchOrientationCSS=t.switchOrientationCSS.bind(t),t.reLayoutActionBar=function(){var t,e,i,n,o="button",r=0,s=5,a=0,l=0,b=0,d=bb.getOrientation(),c=[],h=!1;for(this.actionOverflowBtn&&s--,this.backBtn&&s--,this.tabOverflowBtn&&s--,t=0;this.mainBarTabs.length>t&&a!=s;t++)i=this.mainBarTabs[t],1==i.visible&&a++;for(h=0==a?!0:!1,t=0;this.mainBarButtons.length>t&&a!=s;t++)e=this.mainBarButtons[t],1==e.visible&&a++;for(a=0==a?1:a,h?(s=3,r=bb.device.is1280x720?this.signatureAction?133:a>=s?133:2==a?200:430:bb.device.is1440x1440?this.signatureAction?192:a>=s?192:2==a?300:500:bb.device.is720x720?this.signatureAction?144:a>=s?144:2==a?280:350:this.signatureAction?163:a>=s?163:2==a?230:460):r=Math.floor(this.getUsableWidth()/a),n=this.getAttribute("class"),n=this.switchOrientationCSS(n),this.setAttribute("class",n),this.isVisible&&(bb.screen.currentScreen.outerScrollArea.style.bottom=bb.screen.getActionBarHeight()+"px",bb.scroller&&bb.scroller.refresh()),this.backBtn&&(n=this.backBtn.getAttribute("class"),n=this.switchOrientationCSS(n),this.backBtn.setAttribute("class",n),n=this.backBtn.backslash.getAttribute("class"),n=this.switchOrientationCSS(n),this.backBtn.backslash.setAttribute("class",n),this.backBtn.innerChevron.style.width=bb.device.is1024x600?bb.actionBar10dot3.getBackBtnWidth(this.backBtn)-16+"px":bb.actionBar10dot3.getBackBtnWidth(this.backBtn)-33+"px"),a=0,b=r-2,t=0;this.mainBarTabs.length>t;t++)i=this.mainBarTabs[t],s>a&&1==i.visible?(l+=b+2,i.style.width=b+"px",i.normal=this.switchOrientationCSS(i.normal),i.highlight=this.switchOrientationCSS(i.highlight),n=i.tabInner.getAttribute("class"),n=this.switchOrientationCSS(n),i.tabInner.setAttribute("class",n),n=i.display.getAttribute("class"),n=this.switchOrientationCSS(n),i.display.setAttribute("class",n),o="tab",a++):(i.style.display="none",i.visible=!1);b=r-1;var u=void 0;for(t=0;this.mainBarButtons.length>t;t++)if(e=this.mainBarButtons[t],s>a&&1==e.visible){if(e.isSignatureAction===!0&&0==h){e.visible=!1,e.signatureDiv.style.display="none";continue}void 0==u&&(u=e),c.push(e),e.style["margin-left"]="",l+=b+1,e.style.width=b+"px",e.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+d+" bb-action-bar-10dot3-button-"+bb.screen.controlColor,e.setAttribute("class",e.normal),e.normal=this.switchOrientationCSS(e.normal),n=e.getAttribute("class"),n=this.switchOrientationCSS(n),e.setAttribute("class",n),o="button",a++}else e.style.display="none",e.visible=!1;if(h&&u)if(this.signatureAction){var p,m=c.indexOf(this.signatureAction),g=3-a;3==a?1!=m&&(0===m?(u=c[1],this.signatureAction.parentNode.insertBefore(this.signatureAction,c[2])):(u=c[0],this.signatureAction.parentNode.insertBefore(this.signatureAction,c[1]))):2==a&&0!=m&&(this.signatureAction.parentNode.insertBefore(this.signatureAction,c[0]),u=this.signatureAction),p=bb.device.is1280x720?96:bb.device.is1440x1440?144:120,this.signatureAction.signatureDiv.style["margin-left"]=bb.innerWidth()/2-p/2+"px";var v=0;this.backBtn?v+=bb.actionBar10dot3.getBackBtnWidth(this.backBtn):this.tabOverflowBtn&&(v+=bb.actionBar10dot3.getTabOverflowBtnWidth(this.tabOverflowBtn)),u.style["margin-left"]=1==a?(bb.innerWidth()-r)/2-v+"px":(bb.innerWidth()-3*r)/2+g*r-v+"px"}else u.style["margin-left"]=(this.getUsableWidth()-a*r)/2+"px";if(this.tabOverflowBtn){var f=bb.actionBar10dot3.getTabOverflowBtnWidth(this.tabOverflowBtn)-1;l+=f+2,this.tabOverflowBtn.style.width=f+"px",this.tabOverflowBtn.normal=this.switchOrientationCSS(this.tabOverflowBtn.normal),this.tabOverflowBtn.highlight=this.switchOrientationCSS(this.tabOverflowBtn.highlight),n=this.tabOverflowBtn.getAttribute("class"),n=this.switchOrientationCSS(n),this.tabOverflowBtn.setAttribute("class",n),n=this.tabOverflowBtn.display.getAttribute("class"),n=this.switchOrientationCSS(n),this.tabOverflowBtn.display.setAttribute("class",n),this.tabOverflowBtn.icon.normal=this.switchOrientationCSS(this.tabOverflowBtn.icon.normal),n=this.tabOverflowBtn.icon.getAttribute("class"),n=this.switchOrientationCSS(n),this.tabOverflowBtn.icon.setAttribute("class",n)}this.actionOverflowBtn&&(this.actionOverflowBtn.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+d+" bb-action-bar-10dot3-button-"+bb.screen.controlColor,this.actionOverflowBtn.style.width=bb.actionBar10dot3.getActionOverflowBtnWidth(this.actionOverflowBtn)-1+"px",this.actionOverflowBtn.highlight.style.width=.6*bb.actionBar10dot3.getActionOverflowBtnWidth(this.actionOverflowBtn)+"px",this.actionOverflowBtn.highlight.style["margin-left"]=.2*bb.actionBar10dot3.getActionOverflowBtnWidth(this.actionOverflowBtn)+"px",this.actionOverflowBtn.style.float="right",this.actionOverflowBtn.setAttribute("class",this.actionOverflowBtn.normal),this.actionOverflowBtn.normal=this.switchOrientationCSS(this.actionOverflowBtn.normal),n=this.actionOverflowBtn.getAttribute("class"),n=this.switchOrientationCSS(n),this.actionOverflowBtn.setAttribute("class",n),n=this.actionOverflowBtn.icon.getAttribute("class"),n=this.switchOrientationCSS(n),this.actionOverflowBtn.icon.setAttribute("class",n))},t.reLayoutActionBar=t.reLayoutActionBar.bind(t),window.addEventListener("orientationchange",t.reLayoutActionBar,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:t.reLayoutActionBar}),t.setBackCaption=function(t){this.setAttribute("data-bb-back-caption",t)},t.setBackCaption=t.setBackCaption.bind(t),t.setSelectedTab=function(t){"tab"==t.getAttribute("data-bb-style")&&(bb.actionBar10dot3.highlightAction(t),t.onclick&&t.onclick())},t.setSelectedTab=t.setSelectedTab.bind(t),t.hide=function(){this.isVisible&&(this.style.display="none",this.slideLabel.style.display="none",bb.screen.currentScreen.outerScrollArea.style.bottom="0px",this.isVisible=!1,bb.scroller&&bb.scroller.refresh())},t.hide=t.hide.bind(t),t.show=function(){this.isVisible||(this.style.display="",this.slideLabel.style.display="",bb.screen.currentScreen.outerScrollArea.style.bottom=bb.screen.getActionBarHeight()+"px",this.isVisible=!0,bb.scroller&&bb.scroller.refresh())},t.show=t.show.bind(t),u.length>0){var B;for(l=0;h.length>l;l++)i=h[l],"overflow"!=i.getAttribute("data-bb-img")&&(B=i.cloneNode(!0),B.visibleTab=i,B.actionBar=t,t.tabOverflowMenu.add(B));for(l=0;u.length>l;l++)i=u[l],i.actionBar=t,t.tabOverflowMenu.add(i)}for(l=0;c.length>l;l++)i=c[l],t.menu.add(i);var A,T;for(l=0;h.length>l;l++)A=h[l],n=A.innerHTML,A.actionBar=t,A.visible=!0,A.innerHTML="",T=document.createElement("div"),A.tabInner=T,A.appendChild(T),A.setAttribute("class","bb-action-bar-10dot3-tab-outer"),A.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+m+" bb-action-bar-10dot3-tab-"+bb.screen.controlColor+" bb-action-bar-10dot3-tab-normal-"+bb.screen.controlColor,A.highlight=A.normal+" bb-action-bar-10dot3-tab-selected-"+bb.screen.controlColor,T.setAttribute("class",A.normal),A.visible=!0,A.hasAttribute("data-bb-visible")&&"false"==A.getAttribute("data-bb-visible").toLowerCase()&&(A.visible=!1),a=document.createElement("img"),a.setAttribute("class","bb-action-bar-10dot3-icon"),a.setAttribute("src",A.getAttribute("data-bb-img")),A.icon=a,T.appendChild(a),o=document.createElement("div"),o.setAttribute("class","bb-action-bar-10dot3-action-display bb-action-bar-10dot3-action-display-"+m),o.innerHTML=n,A.display=o,T.appendChild(o),A.hasAttribute("data-bb-selected")&&"true"==A.getAttribute("data-bb-selected").toLowerCase()&&bb.actionBar10dot3.highlightAction(A),A.addEventListener("click",function(){bb.actionBar10dot3.highlightAction(this)},!1),A.setCaption=function(t){if(this.display.innerHTML=t,this.actionBar.tabOverflowMenu){var e,i,n=this.actionBar.tabOverflowMenu.actions;for(e=0;n.length>e;e++)i=n[e],i.visibleTab==this&&i.setCaption(t)}},A.setCaption=A.setCaption.bind(A),A.getCaption=function(){return this.display.innerHTML},A.getCaption=A.getCaption.bind(A),A.setImage=function(t){if(this.icon.setAttribute("src",t),this.actionBar.tabOverflowMenu){var e,i,n=this.actionBar.tabOverflowMenu.actions;for(e=0;n.length>e;e++)i=n[e],i.visibleTab==this&&i.setImage(t)}},A.setImage=A.setImage.bind(A),A.getImage=function(){return this.icon.getAttribute("src")},A.getImage=A.getImage.bind(A),A.hide=bb.actionBar10dot3.actionHide,A.hide=A.hide.bind(A),A.show=bb.actionBar10dot3.actionShow,A.show=A.show.bind(A),A.ontouchstart=function(){this.actionBar.showLabel(this,this.display.innerHTML)},A.ontouchend=function(){this.actionBar.doTouchEnd()};var S;t.tabOverflowBtn&&(S=t.tabOverflowBtn,n=S.innerHTML,S.actionBar=t,S.visible=!0,S.innerHTML="",T=document.createElement("div"),S.tabInner=T,S.appendChild(T),S.setAttribute("class","bb-action-bar-10dot3-tab-outer"),S.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+m+" bb-action-bar-10dot3-tab-"+bb.screen.controlColor+" bb-action-bar-10dot3-tab-normal-"+bb.screen.controlColor,S.highlight=S.normal+" bb-action-bar-10dot3-tab-selected-"+bb.screen.controlColor,T.setAttribute("class",S.normal),a=document.createElement("img"),a.setAttribute("class","bb-action-bar-10dot3-icon"),a.setAttribute("src",bb.transparentPixel),a.normal="bb-action-bar-10dot3-icon bb-action-bar-10dot3-tab-overflow-"+bb.screen.controlColor+" bb-action-bar-10dot3-tab-overflow-"+m,a.highlight="bb-action-bar-10dot3-icon",a.setAttribute("class",a.normal),T.appendChild(a),o=document.createElement("div"),o.setAttribute("class","bb-action-bar-10dot3-action-display bb-action-bar-10dot3-action-display-"+m),o.innerHTML=n,S.display=o,T.appendChild(o),S.icon=a,o.innerHTML=" ",S.display=o,S.style.width=bb.actionBar10dot3.getTabOverflowBtnWidth(S)-1+"px",S.reset=function(){this.icon.setAttribute("src",bb.transparentPixel),this.icon.setAttribute("class",this.icon.normal),this.display.innerHTML=" "},S.reset=S.reset.bind(S),S.ontouchstart=function(){this.tabInner.style["background-color"]="light"==bb.screen.controlColor?"#DDDDDD":"#3A3A3A";var t=""==this.display.innerHTML||" "==this.display.innerHTML?this.actionBar.moreCaption:this.display.innerHTML;this.actionBar.showLabel(this,t)},S.ontouchend=function(){this.tabInner.style["background-color"]="",this.actionBar.doTouchEnd()});var O;for(l=0;d.length>l;l++)O=d[l],O.actionBar=t,O.isSignatureAction=!1,n=O.innerHTML,void 0==t.signatureAction&&O.hasAttribute("data-bb-signature")&&"true"==O.getAttribute("data-bb-signature").toLowerCase()&&(t.signatureAction=O,O.isSignatureAction=!0),a=document.createElement("img"),a.setAttribute("src",O.getAttribute("data-bb-img")),a.setAttribute("class","bb-action-bar-10dot3-icon"),O.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+m+" bb-action-bar-10dot3-button-"+bb.screen.controlColor,O.visible=!0,O.hasAttribute("data-bb-visible")&&"false"==O.getAttribute("data-bb-visible").toLowerCase()&&(O.visible=!1),O.icon=a,O.innerHTML="",O.isSignatureAction===!0?(O.signatureDiv=document.createElement("div"),O.signatureDiv.setAttribute("class","bb-action-bar-10dot3-signature-icon"),O.signatureDiv.style["background-color"]=bb.options.highlightColor,O.signatureDiv.style["background-image"]='url("'+O.getAttribute("data-bb-img")+'")',e.appendChild(O.signatureDiv),O.signatureDiv.highlight=function(){this.style["background-color"]=bb.options.shades.darkHighlight},O.signatureDiv.highlight=O.signatureDiv.highlight.bind(O.signatureDiv),O.signatureDiv.unhighlight=function(){this.style["background-color"]=bb.options.highlightColor},O.signatureDiv.unhighlight=O.signatureDiv.unhighlight.bind(O.signatureDiv),O.signatureDiv.ontouchstart=function(){this.highlight()},O.signatureDiv.ontouchend=function(){this.unhighlight()},O.signatureDiv.onclick=O.onclick):O.appendChild(a),O.setAttribute("class",O.normal),o=document.createElement("div"),O.isSignatureAction===!0?o.setAttribute("class","bb-action-bar-10dot3-action-display bb-action-bar-10dot3-signature-action-display"):o.setAttribute("class","bb-action-bar-10dot3-action-display"),o.innerHTML=n,O.display=o,O.appendChild(o),O.highlight=document.createElement("div"),O.highlight.setAttribute("class","bb-action-bar-10dot3-action-highlight"),O.highlight.style.height=bb.device.is1024x600?"4px":"8px",O.highlight.style["background-color"]="transparent",O.appendChild(O.highlight),O.setCaption=function(t){this.display.innerHTML=t},O.setCaption=O.setCaption.bind(O),O.getCaption=function(){return this.display.innerHTML},O.getCaption=O.getCaption.bind(O),O.setImage=function(t){this.isSignatureAction?this.signatureDiv.style["background-image"]='url("'+t+'")':this.icon.setAttribute("src",t),this.setAttribute("data-bb-img",t)},O.setImage=O.setImage.bind(O),O.getImage=function(){return this.getAttribute("data-bb-img")},O.getImage=O.getImage.bind(O),O.hide=bb.actionBar10dot3.actionHide,O.hide=O.hide.bind(O),O.show=bb.actionBar10dot3.actionShow,O.show=O.show.bind(O),O.ontouchstart=function(){this.isSignatureAction===!0?this.signatureDiv.style["background-color"]=bb.options.shades.darkHighlight:this.style["background-color"]="light"==bb.screen.controlColor?"#DDDDDD":"#3A3A3A",this.actionBar.showLabel(this,this.display.innerHTML)},O.ontouchend=function(){this.isSignatureAction===!0?this.signatureDiv.style["background-color"]=bb.options.highlightColor:(this.style["background-color"]="transparent",this.actionBar.doTouchEnd())};if(t.actionOverflowBtn){actionOverflow=t.actionOverflowBtn,actionOverflow.actionBar=t,actionOverflow.visible=!0,n=actionOverflow.innerHTML,a=document.createElement("img"),a.setAttribute("src",bb.transparentPixel),a.setAttribute("class","bb-action-bar-10dot3-icon bb-action-bar-10dot3-overflow-button-"+bb.screen.controlColor+" bb-action-bar-10dot3-overflow-button-"+m),actionOverflow.icon=a,actionOverflow.normal="bb-action-bar-10dot3-action bb-action-bar-10dot3-action-"+m+" bb-action-bar-10dot3-button-"+bb.screen.controlColor,actionOverflow.innerHTML="",actionOverflow.setAttribute("class",actionOverflow.normal),actionOverflow.appendChild(a);var o=document.createElement("div");o.setAttribute("class","bb-action-bar-10dot3-action-display"),actionOverflow.display=o,actionOverflow.appendChild(o),actionOverflow.highlight=document.createElement("div"),actionOverflow.highlight.setAttribute("class","bb-action-bar-10dot3-action-highlight"),actionOverflow.highlight.style.height=bb.device.is1024x600?"4px":"8px",actionOverflow.highlight.style["background-color"]="transparent",actionOverflow.appendChild(actionOverflow.highlight),actionOverflow.ontouchstart=function(){this.style["background-color"]="light"==bb.screen.controlColor?"#DDDDDD":"#3A3A3A",this.actionBar.showLabel(this,this.actionBar.moreCaption)},actionOverflow.ontouchend=function(){this.style["background-color"]="transparent",this.actionBar.doTouchEnd()}}t.menu&&t.menu.centerMenuItems(),t.tabOverflowMenu&&(t.tabOverflowMenu.centerMenuItems(),t.tabOverflowMenu.initSelected()),t.reLayoutActionBar()},actionShow:function(){this.visible||(this.style.display="",this.visible=!0,this.actionBar.reLayoutActionBar())},actionHide:function(){this.visible&&(this.style.display="none",this.visible=!1,this.actionBar.reLayoutActionBar())},getTabOverflowBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is720x720?bb.device.newerThan10dot2?109:144:bb.device.is1280x720?96:bb.device.is1440x1440?144:120:0},getActionOverflowBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is720x720?bb.device.newerThan10dot2?109:144:bb.device.is1280x720?96:bb.device.is1440x1440?144:120:0},getBackBtnWidth:function(t){return t?bb.device.is1024x600?"portrait"==bb.getOrientation()?93:150:bb.device.is720x720?bb.device.newerThan10dot2?121:174:bb.device.is1280x720?104:bb.device.is1440x1440?168:129:0},highlightAction:function(t,e){var i,n,o=t.actionBar.mainBarTabs;for(i=0;o.length>i;i++)n=o[i],n!=t&&bb.actionBar10dot3.unhighlightAction(n);if(t.actionBar.tabOverflowMenu)for(o=t.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n!=e&&bb.actionBar10dot3.unhighlightAction(n);if(t.tabInner?t.tabInner!=t.actionBar.tabOverflowBtn.tabInner&&(t.tabInner.style["border-top-color"]=bb.options.highlightColor,t.tabInner.setAttribute("class",t.highlight)):(t.style["border-top-color"]=bb.options.highlightColor,t.setAttribute("class",t.highlight)),t.selected=!0,e&&(e.setAttribute("class",e.normal+" bb10Highlight"),e.selected=!0),t.actionBar.tabOverflowMenu&&!e)if(t.actionBar.tabOverflowBtn&&t==t.actionBar.tabOverflowBtn)e.setAttribute("class",e.normal+" bb10Highlight");else for(o=t.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n.visibleTab==t&&n.setAttribute("class",n.normal+" bb10Highlight");t.actionBar.tabOverflowBtn&&t.actionBar.tabOverflowBtn.reset&&t.actionBar.tabOverflowBtn.reset()},unhighlightAction:function(t){var e;if(t.tabInner?(t.tabInner.style["border-top-color"]="",t.tabInner.setAttribute("class",t.normal)):(t.style["border-top-color"]="",t.setAttribute("class",t.normal)),t.actionBar&&t.actionBar.tabOverflowMenu)for(tabs=t.actionBar.tabOverflowMenu.actions,i=0;tabs.length>i;i++)e=tabs[i],e.tabInner?e.tabInner.setAttribute("class",e.normal):e.setAttribute("class",e.normal),e.selected=!1}},_bb_bbmBubble={apply:function(t){for(var e=0;t.length>e;e++)bb.bbmBubble.style(t[e])},style:function(t){var e,i,n,o;if(t.styleItem=function(e){return i=document.createElement("img"),i.setAttribute("src",e.getAttribute("data-bb-img")),o=document.createElement("div"),o.setAttribute("class","details"),o.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(i),e.appendChild(o),e.image=i,e.details=o,e.outerElement=t,e.getCaption=function(){return this.details.innerText},e.getCaption=e.getCaption.bind(e),e.setCaption=function(t){this.details.innerHTML=t,bb.refresh()},e.setCaption=e.setCaption.bind(e),e.getImage=function(){return this.image.src},e.getImage=e.getImage.bind(e),e.setImage=function(t){this.image.setAttribute("src",t),bb.refresh()},e.setImage=e.setImage.bind(e),e.remove=function(){this.outerHTML="",bb.refresh()},e.remove=e.remove.bind(e),e},t.styleItem=t.styleItem.bind(t),t.hasAttribute("data-bb-style")){var r,s=t.getAttribute("data-bb-style").toLowerCase();"left"==s?t.setAttribute("class","bb-bbm-bubble-left"):t.setAttribute("class","bb-bbm-bubble-right");var a=t.querySelectorAll("[data-bb-type=item]");for(r=0;r>a.length;r++)t.removeChild(a[r]);for(e=document.createElement("div"),e.setAttribute("class","top-left image"),t.appendChild(e),e=document.createElement("div"),e.setAttribute("class","top-right image"),t.appendChild(e),e=document.createElement("div"),e.setAttribute("class","inside"),t.appendChild(e),insidePanel=document.createElement("div"),insidePanel.setAttribute("class","nogap"),e.appendChild(insidePanel),t.insidePanel=insidePanel,e=document.createElement("div"),e.setAttribute("class","bottom-left image"),t.appendChild(e),e=document.createElement("div"),e.setAttribute("class","bottom-right image"),t.appendChild(e),r=0;a.length>r;r++)n=a[r],insidePanel.appendChild(t.styleItem(n))
}return t.getStyle=function(){return this.getAttribute("data-bb-style")},t.getStyle=t.getStyle.bind(t),t.setStyle=function(t){"left"==t?(this.setAttribute("data-bb-style",t),this.setAttribute("class","bb-bbm-bubble-left")):"right"==t&&(this.setAttribute("data-bb-style",t),this.setAttribute("class","bb-bbm-bubble-right")),bb.refresh()},t.setStyle=t.setStyle.bind(t),t.show=function(){this.style.display="block",bb.refresh()},t.show=t.show.bind(t),t.hide=function(){this.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.parentNode.removeChild(this),bb.refresh()},t.remove=t.remove.bind(t),t.clear=function(){this.insidePanel.innerHTML="",bb.refresh()},t.clear=t.clear.bind(t),t.getItems=function(){return this.querySelectorAll("[data-bb-type=item]")},t.getItems=t.getItems.bind(t),t}},function(){var t=Math,e=function(t){return t>>0},i=/webkit/i.test(navigator.appVersion)?"webkit":/firefox/i.test(navigator.userAgent)?"Moz":/trident/i.test(navigator.userAgent)?"ms":"opera"in window?"O":"",n=/android/gi.test(navigator.appVersion),o=/iphone|ipad/gi.test(navigator.appVersion),r=/playbook/gi.test(navigator.appVersion),s=/hp-tablet/gi.test(navigator.appVersion),a="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,l="ontouchstart"in window&&!s,b=i+"Transform"in document.documentElement.style,d=o||r,c=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,1)}}(),h=function(){return window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout}(),u="onorientationchange"in window?"orientationchange":"resize",p=l?"touchstart":"mousedown",m=l?"touchmove":"mousemove",g=l?"touchend":"mouseup",v=l?"touchcancel":"mouseup",f="Moz"==i?"DOMMouseScroll":"mousewheel",y="translate"+(a?"3d(":"("),w=a?",0)":")",E=function(t,e){var r,s=this,c=document;s.wrapper="object"==typeof t?t:c.getElementById(t),s.wrapper.style.overflow="hidden",s.scroller=s.wrapper.children[0],s.options={hScroll:!0,vScroll:!0,x:0,y:0,bounce:!0,bounceLock:!1,momentum:!0,lockDirection:!0,useTransform:!0,useTransition:!1,topOffset:0,checkDOMChanges:!1,hScrollbar:!0,vScrollbar:!0,fixedScrollbar:n,hideScrollbar:o,fadeScrollbar:o&&a,scrollbarClass:"",zoom:!1,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:!1,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(t){t.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null};for(r in e)s.options[r]=e[r];s.x=s.options.x,s.y=s.options.y,s.options.useTransform=b?s.options.useTransform:!1,s.options.hScrollbar=s.options.hScroll&&s.options.hScrollbar,s.options.vScrollbar=s.options.vScroll&&s.options.vScrollbar,s.options.zoom=s.options.useTransform&&s.options.zoom,s.options.useTransition=d&&s.options.useTransition,s.options.zoom&&n&&(y="translate(",w=")"),s.scroller.style[i+"TransitionProperty"]=s.options.useTransform?"-"+i.toLowerCase()+"-transform":"top left",s.scroller.style[i+"TransitionDuration"]="0",s.scroller.style[i+"TransformOrigin"]="0 0",s.options.useTransition&&(s.scroller.style[i+"TransitionTimingFunction"]="cubic-bezier(0.33,0.66,0.66,1)"),s.options.useTransform?s.scroller.style[i+"Transform"]=y+s.x+"px,"+s.y+"px"+w:s.scroller.style.cssText+=";position:absolute;top:"+s.y+"px;left:"+s.x+"px",s.options.useTransition&&(s.options.fixedScrollbar=!0),s.refresh(),s._bind(u,window),s._bind(p),l||(s._bind("mouseout",s.wrapper),"none"!=s.options.wheelAction&&s._bind(f)),s.options.checkDOMChanges&&(s.checkDOMTime=setInterval(function(){s._checkDOMChanges()},500))};E.prototype={enabled:!0,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,wheelZoomCount:0,handleEvent:function(t){var e=this;switch(t.type){case p:if(!l&&0!==t.button)return;e._start(t);break;case m:e._move(t);break;case g:case v:e._end(t);break;case u:e._resize();break;case f:e._wheel(t);break;case"mouseout":e._mouseout(t);break;case"webkitTransitionEnd":e._transitionEnd(t)}},_checkDOMChanges:function(){this.moved||this.zoomed||this.animating||this.scrollerW==this.scroller.offsetWidth*this.scale&&this.scrollerH==this.scroller.offsetHeight*this.scale||this.refresh()},_scrollbar:function(n){var o,r=this,s=document;return r[n+"Scrollbar"]?(r[n+"ScrollbarWrapper"]||(o=s.createElement("div"),r.options.scrollbarClass?o.className=r.options.scrollbarClass+n.toUpperCase():o.style.cssText="position:absolute;z-index:100;"+("h"==n?"height:7px;bottom:1px;left:2px;right:"+(r.vScrollbar?"7":"2")+"px":"width:7px;bottom:"+(r.hScrollbar?"7":"2")+"px;top:2px;right:1px"),o.style.cssText+=";pointer-events:none;-"+i+"-transition-property:opacity;-"+i+"-transition-duration:"+(r.options.fadeScrollbar?"350ms":"0")+";overflow:hidden;opacity:"+(r.options.hideScrollbar?"0":"1"),r.wrapper.appendChild(o),r[n+"ScrollbarWrapper"]=o,o=s.createElement("div"),r.options.scrollbarClass||(o.style.cssText="position:absolute;z-index:100;background:rgba(0,0,0,0.3);border:1px solid rgba(255,255,255,0.9);-"+i+"-background-clip:padding-box;-"+i+"-box-sizing:border-box;"+("h"==n?"height:100%":"width:100%")+";-"+i+"-border-radius:3px;border-radius:3px"),o.style.cssText+=";pointer-events:none;-"+i+"-transition-property:-"+i+"-transform;-"+i+"-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);-"+i+"-transition-duration:0;-"+i+"-transform:"+y+"0,0"+w,r.options.useTransition&&(o.style.cssText+=";-"+i+"-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)"),r[n+"ScrollbarWrapper"].appendChild(o),r[n+"ScrollbarIndicator"]=o),"h"==n?(r.hScrollbarSize=r.hScrollbarWrapper.clientWidth,r.hScrollbarIndicatorSize=t.max(e(r.hScrollbarSize*r.hScrollbarSize/r.scrollerW),8),r.hScrollbarIndicator.style.width=r.hScrollbarIndicatorSize+"px",r.hScrollbarMaxScroll=r.hScrollbarSize-r.hScrollbarIndicatorSize,r.hScrollbarProp=r.hScrollbarMaxScroll/r.maxScrollX):(r.vScrollbarSize=r.vScrollbarWrapper.clientHeight,r.vScrollbarIndicatorSize=t.max(e(r.vScrollbarSize*r.vScrollbarSize/r.scrollerH),8),r.vScrollbarIndicator.style.height=r.vScrollbarIndicatorSize+"px",r.vScrollbarMaxScroll=r.vScrollbarSize-r.vScrollbarIndicatorSize,r.vScrollbarProp=r.vScrollbarMaxScroll/r.maxScrollY),r._scrollbarPos(n,!0),void 0):(r[n+"ScrollbarWrapper"]&&(b&&(r[n+"ScrollbarIndicator"].style[i+"Transform"]=""),r[n+"ScrollbarWrapper"].parentNode.removeChild(r[n+"ScrollbarWrapper"]),r[n+"ScrollbarWrapper"]=null,r[n+"ScrollbarIndicator"]=null),void 0)},_resize:function(){var t=this;setTimeout(function(){t.refresh()},n?200:0)},_pos:function(t,n){t=this.hScroll?t:0,n=this.vScroll?n:0,this.options.useTransform?this.scroller.style[i+"Transform"]=y+t+"px,"+n+"px"+w+" scale("+this.scale+")":(t=e(t),n=e(n),this.scroller.style.left=t+"px",this.scroller.style.top=n+"px"),this.x=t,this.y=n,this._scrollbarPos("h"),this._scrollbarPos("v")},_scrollbarPos:function(t,n){var o,r=this,s="h"==t?r.x:r.y;r[t+"Scrollbar"]&&(s=r[t+"ScrollbarProp"]*s,0>s?(r.options.fixedScrollbar||(o=r[t+"ScrollbarIndicatorSize"]+e(3*s),8>o&&(o=8),r[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=o+"px"),s=0):s>r[t+"ScrollbarMaxScroll"]&&(r.options.fixedScrollbar?s=r[t+"ScrollbarMaxScroll"]:(o=r[t+"ScrollbarIndicatorSize"]-e(3*(s-r[t+"ScrollbarMaxScroll"])),8>o&&(o=8),r[t+"ScrollbarIndicator"].style["h"==t?"width":"height"]=o+"px",s=r[t+"ScrollbarMaxScroll"]+(r[t+"ScrollbarIndicatorSize"]-o))),r[t+"ScrollbarWrapper"].style[i+"TransitionDelay"]="0",r[t+"ScrollbarWrapper"].style.opacity=n&&r.options.hideScrollbar?"0":"1",r[t+"ScrollbarIndicator"].style[i+"Transform"]=y+("h"==t?s+"px,0":"0,"+s+"px")+w)},_start:function(e){var n,o,r,s,a,b=this,d=l?e.touches[0]:e;b.enabled&&(b.options.onBeforeScrollStart&&b.options.onBeforeScrollStart.call(b,e),(b.options.useTransition||b.options.zoom)&&b._transitionTime(0),b.moved=!1,b.animating=!1,b.zoomed=!1,b.distX=0,b.distY=0,b.absDistX=0,b.absDistY=0,b.dirX=0,b.dirY=0,b.options.zoom&&l&&e.touches.length>1&&(s=t.abs(e.touches[0].pageX-e.touches[1].pageX),a=t.abs(e.touches[0].pageY-e.touches[1].pageY),b.touchesDistStart=t.sqrt(s*s+a*a),b.originX=t.abs(e.touches[0].pageX+e.touches[1].pageX-2*b.wrapperOffsetLeft)/2-b.x,b.originY=t.abs(e.touches[0].pageY+e.touches[1].pageY-2*b.wrapperOffsetTop)/2-b.y,b.options.onZoomStart&&b.options.onZoomStart.call(b,e)),b.options.momentum&&(b.options.useTransform?(n=getComputedStyle(b.scroller,null)[i+"Transform"].replace(/[^0-9-.,]/g,"").split(","),o=1*n[4],r=1*n[5]):(o=1*getComputedStyle(b.scroller,null).left.replace(/[^0-9-]/g,""),r=1*getComputedStyle(b.scroller,null).top.replace(/[^0-9-]/g,"")),(o!=b.x||r!=b.y)&&(b.options.useTransition?b._unbind("webkitTransitionEnd"):h(b.aniTime),b.steps=[],b._pos(o,r))),b.absStartX=b.x,b.absStartY=b.y,b.startX=b.x,b.startY=b.y,b.pointX=d.pageX,b.pointY=d.pageY,b.startTime=e.timeStamp||Date.now(),b.options.onScrollStart&&b.options.onScrollStart.call(b,e),b._bind(m),b._bind(g),b._bind(v))},_move:function(e){var n,o,r,s=this,a=l?e.touches[0]:e,b=a.pageX-s.pointX,d=a.pageY-s.pointY,c=s.x+b,h=s.y+d,u=e.timeStamp||Date.now();return s.options.onBeforeScrollMove&&s.options.onBeforeScrollMove.call(s,e),s.options.zoom&&l&&e.touches.length>1?(n=t.abs(e.touches[0].pageX-e.touches[1].pageX),o=t.abs(e.touches[0].pageY-e.touches[1].pageY),s.touchesDist=t.sqrt(n*n+o*o),s.zoomed=!0,r=1/s.touchesDistStart*s.touchesDist*this.scale,s.options.zoomMin>r?r=.5*s.options.zoomMin*Math.pow(2,r/s.options.zoomMin):r>s.options.zoomMax&&(r=2*s.options.zoomMax*Math.pow(.5,s.options.zoomMax/r)),s.lastScale=r/this.scale,c=this.originX-this.originX*s.lastScale+this.x,h=this.originY-this.originY*s.lastScale+this.y,this.scroller.style[i+"Transform"]=y+c+"px,"+h+"px"+w+" scale("+r+")",s.options.onZoom&&s.options.onZoom.call(s,e),void 0):(s.pointX=a.pageX,s.pointY=a.pageY,(c>0||s.maxScrollX>c)&&(c=s.options.bounce?s.x+b/2:c>=0||s.maxScrollX>=0?0:s.maxScrollX),(h>s.minScrollY||s.maxScrollY>h)&&(h=s.options.bounce?s.y+d/2:h>=s.minScrollY||s.maxScrollY>=0?s.minScrollY:s.maxScrollY),s.distX+=b,s.distY+=d,s.absDistX=t.abs(s.distX),s.absDistY=t.abs(s.distY),6>s.absDistX&&6>s.absDistY||(s.options.lockDirection&&(s.absDistX>s.absDistY+5?(h=s.y,d=0):s.absDistY>s.absDistX+5&&(c=s.x,b=0)),s.moved=!0,s._pos(c,h),s.dirX=b>0?-1:0>b?1:0,s.dirY=d>0?-1:0>d?1:0,u-s.startTime>300&&(s.startTime=u,s.startX=s.x,s.startY=s.y),s.options.onScrollMove&&s.options.onScrollMove.call(s,e)),void 0)},_end:function(n){if(!l||0==n.touches.length){var o,r,s,a,b,d,c,h=this,u=l?n.changedTouches[0]:n,p={dist:0,time:0},f={dist:0,time:0},E=(n.timeStamp||Date.now())-h.startTime,x=h.x,C=h.y;if(h._unbind(m),h._unbind(g),h._unbind(v),h.options.onBeforeScrollEnd&&h.options.onBeforeScrollEnd.call(h,n),h.zoomed)return c=h.scale*h.lastScale,c=Math.max(h.options.zoomMin,c),c=Math.min(h.options.zoomMax,c),h.lastScale=c/h.scale,h.scale=c,h.x=h.originX-h.originX*h.lastScale+h.x,h.y=h.originY-h.originY*h.lastScale+h.y,h.scroller.style[i+"TransitionDuration"]="200ms",h.scroller.style[i+"Transform"]=y+h.x+"px,"+h.y+"px"+w+" scale("+h.scale+")",h.zoomed=!1,h.refresh(),h.options.onZoomEnd&&h.options.onZoomEnd.call(h,n),void 0;if(!h.moved)return l&&(h.doubleTapTimer&&h.options.zoom?(clearTimeout(h.doubleTapTimer),h.doubleTapTimer=null,h.options.onZoomStart&&h.options.onZoomStart.call(h,n),h.zoom(h.pointX,h.pointY,1==h.scale?h.options.doubleTapZoom:1),h.options.onZoomEnd&&setTimeout(function(){h.options.onZoomEnd.call(h,n)},200)):h.doubleTapTimer=setTimeout(function(){for(h.doubleTapTimer=null,o=u.target;1!=o.nodeType;)o=o.parentNode;"SELECT"!=o.tagName&&"INPUT"!=o.tagName&&"TEXTAREA"!=o.tagName&&(r=document.createEvent("MouseEvents"),r.initMouseEvent("click",!0,!0,n.view,1,u.screenX,u.screenY,u.clientX,u.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,0,null),r._fake=!0,o.dispatchEvent(r))},h.options.zoom?250:0)),h._resetPos(200),h.options.onTouchEnd&&h.options.onTouchEnd.call(h,n),void 0;if(300>E&&h.options.momentum&&(p=x?h._momentum(x-h.startX,E,-h.x,h.scrollerW-h.wrapperW+h.x,h.options.bounce?h.wrapperW:0):p,f=C?h._momentum(C-h.startY,E,-h.y,0>h.maxScrollY?h.scrollerH-h.wrapperH+h.y-h.minScrollY:0,h.options.bounce?h.wrapperH:0):f,x=h.x+p.dist,C=h.y+f.dist,(h.x>0&&x>0||h.x<h.maxScrollX&&h.maxScrollX>x)&&(p={dist:0,time:0}),(h.y>h.minScrollY&&C>h.minScrollY||h.y<h.maxScrollY&&h.maxScrollY>C)&&(f={dist:0,time:0})),p.dist||f.dist)return b=t.max(t.max(p.time,f.time),10),h.options.snap&&(s=x-h.absStartX,a=C-h.absStartY,t.abs(s)<h.options.snapThreshold&&t.abs(a)<h.options.snapThreshold?h.scrollTo(h.absStartX,h.absStartY,200):(d=h._snap(x,C),x=d.x,C=d.y,b=t.max(d.time,b))),h.scrollTo(e(x),e(C),b),h.options.onTouchEnd&&h.options.onTouchEnd.call(h,n),void 0;if(h.options.snap)return s=x-h.absStartX,a=C-h.absStartY,t.abs(s)<h.options.snapThreshold&&t.abs(a)<h.options.snapThreshold?h.scrollTo(h.absStartX,h.absStartY,200):(d=h._snap(h.x,h.y),(d.x!=h.x||d.y!=h.y)&&h.scrollTo(d.x,d.y,d.time)),h.options.onTouchEnd&&h.options.onTouchEnd.call(h,n),void 0;h._resetPos(200),h.options.onTouchEnd&&h.options.onTouchEnd.call(h,n)}},_resetPos:function(t){var e=this,n=e.x>=0?0:e.x<e.maxScrollX?e.maxScrollX:e.x,o=e.y>=e.minScrollY||e.maxScrollY>0?e.minScrollY:e.y<e.maxScrollY?e.maxScrollY:e.y;return n==e.x&&o==e.y?(e.moved&&(e.moved=!1,e.options.onScrollEnd&&e.options.onScrollEnd.call(e)),e.hScrollbar&&e.options.hideScrollbar&&("webkit"==i&&(e.hScrollbarWrapper.style[i+"TransitionDelay"]="300ms"),e.hScrollbarWrapper.style.opacity="0"),e.vScrollbar&&e.options.hideScrollbar&&("webkit"==i&&(e.vScrollbarWrapper.style[i+"TransitionDelay"]="300ms"),e.vScrollbarWrapper.style.opacity="0"),void 0):(e.scrollTo(n,o,t||0),void 0)},_wheel:function(t){var e,i,n,o,r,s=this;if("wheelDeltaX"in t)e=t.wheelDeltaX/12,i=t.wheelDeltaY/12;else if("wheelDelta"in t)e=i=t.wheelDelta/12;else{if(!("detail"in t))return;e=i=3*-t.detail}return"zoom"==s.options.wheelAction?(r=s.scale*Math.pow(2,1/3*(i?i/Math.abs(i):0)),s.options.zoomMin>r&&(r=s.options.zoomMin),r>s.options.zoomMax&&(r=s.options.zoomMax),r!=s.scale&&(!s.wheelZoomCount&&s.options.onZoomStart&&s.options.onZoomStart.call(s,t),s.wheelZoomCount++,s.zoom(t.pageX,t.pageY,r,400),setTimeout(function(){s.wheelZoomCount--,!s.wheelZoomCount&&s.options.onZoomEnd&&s.options.onZoomEnd.call(s,t)},400)),void 0):(n=s.x+e,o=s.y+i,n>0?n=0:s.maxScrollX>n&&(n=s.maxScrollX),o>s.minScrollY?o=s.minScrollY:s.maxScrollY>o&&(o=s.maxScrollY),s.scrollTo(n,o,0),void 0)},_mouseout:function(t){var e=t.relatedTarget;if(!e)return this._end(t),void 0;for(;e=e.parentNode;)if(e==this.wrapper)return;this._end(t)},_transitionEnd:function(t){var e=this;t.target==e.scroller&&(e._unbind("webkitTransitionEnd"),e._startAni())},_startAni:function(){var e,i,n,o=this,r=o.x,s=o.y,a=Date.now();if(!o.animating){if(!o.steps.length)return o._resetPos(400),void 0;if(e=o.steps.shift(),e.x==r&&e.y==s&&(e.time=0),o.animating=!0,o.moved=!0,o.options.useTransition)return o._transitionTime(e.time),o._pos(e.x,e.y),o.animating=!1,e.time?o._bind("webkitTransitionEnd"):o._resetPos(0),void 0;n=function(){var l,b,d=Date.now();return d>=a+e.time?(o._pos(e.x,e.y),o.animating=!1,o.options.onAnimationEnd&&o.options.onAnimationEnd.call(o),o._startAni(),void 0):(d=(d-a)/e.time-1,i=t.sqrt(1-d*d),l=(e.x-r)*i+r,b=(e.y-s)*i+s,o._pos(l,b),o.animating&&(o.aniTime=c(n)),void 0)},n()}},_transitionTime:function(t){t+="ms",this.scroller.style[i+"TransitionDuration"]=t,this.hScrollbar&&(this.hScrollbarIndicator.style[i+"TransitionDuration"]=t),this.vScrollbar&&(this.vScrollbarIndicator.style[i+"TransitionDuration"]=t)},_momentum:function(i,n,o,r,s){var a=6e-4,l=t.abs(i)/n,b=l*l/(2*a),d=0,c=0;return i>0&&b>o?(c=s/(6/(b/l*a)),o+=c,l=l*o/b,b=o):0>i&&b>r&&(c=s/(6/(b/l*a)),r+=c,l=l*r/b,b=r),b*=0>i?-1:1,d=l/a,{dist:b,time:e(d)}},_offset:function(t){for(var e=-t.offsetLeft,i=-t.offsetTop;t=t.offsetParent;)e-=t.offsetLeft,i-=t.offsetTop;return t!=this.wrapper&&(e*=this.scale,i*=this.scale),{left:e,top:i}},_snap:function(i,n){var o,r,s,a,l,b,d=this;for(s=d.pagesX.length-1,o=0,r=d.pagesX.length;r>o;o++)if(i>=d.pagesX[o]){s=o;break}for(s==d.currPageX&&s>0&&0>d.dirX&&s--,i=d.pagesX[s],l=t.abs(i-d.pagesX[d.currPageX]),l=l?500*(t.abs(d.x-i)/l):0,d.currPageX=s,s=d.pagesY.length-1,o=0;s>o;o++)if(n>=d.pagesY[o]){s=o;break}return s==d.currPageY&&s>0&&0>d.dirY&&s--,n=d.pagesY[s],b=t.abs(n-d.pagesY[d.currPageY]),b=b?500*(t.abs(d.y-n)/b):0,d.currPageY=s,a=e(t.max(l,b))||200,{x:i,y:n,time:a}},_bind:function(t,e,i){(e||this.scroller).addEventListener(t,this,!!i)},_unbind:function(t,e,i){(e||this.scroller).removeEventListener(t,this,!!i)},destroy:function(){var t=this;t.scroller.style[i+"Transform"]="",t.hScrollbar=!1,t.vScrollbar=!1,t._scrollbar("h"),t._scrollbar("v"),t._unbind(u,window),t._unbind(p),t._unbind(m),t._unbind(g),t._unbind(v),t.options.hasTouch||(t._unbind("mouseout",t.wrapper),t._unbind(f)),t.options.useTransition&&t._unbind("webkitTransitionEnd"),t.options.checkDOMChanges&&clearInterval(t.checkDOMTime),t.options.onDestroy&&t.options.onDestroy.call(t)},refresh:function(){var t,n,o,r,s=this,a=0,l=0;if(s.scale<s.options.zoomMin&&(s.scale=s.options.zoomMin),s.wrapperW=s.wrapper.clientWidth||1,s.wrapperH=s.wrapper.clientHeight||1,s.minScrollY=-s.options.topOffset||0,s.scrollerW=e(s.scroller.offsetWidth*s.scale),s.scrollerH=e((s.scroller.offsetHeight+s.minScrollY)*s.scale),s.maxScrollX=s.wrapperW-s.scrollerW,s.maxScrollY=s.wrapperH-s.scrollerH+s.minScrollY,s.dirX=0,s.dirY=0,s.options.onRefresh&&s.options.onRefresh.call(s),s.hScroll=s.options.hScroll&&0>s.maxScrollX,s.vScroll=s.options.vScroll&&(!s.options.bounceLock&&!s.hScroll||s.scrollerH>s.wrapperH),s.hScrollbar=s.hScroll&&s.options.hScrollbar,s.vScrollbar=s.vScroll&&s.options.vScrollbar&&s.scrollerH>s.wrapperH,t=s._offset(s.wrapper),s.wrapperOffsetLeft=-t.left,s.wrapperOffsetTop=-t.top,"string"==typeof s.options.snap)for(s.pagesX=[],s.pagesY=[],r=s.scroller.querySelectorAll(s.options.snap),n=0,o=r.length;o>n;n++)a=s._offset(r[n]),a.left+=s.wrapperOffsetLeft,a.top+=s.wrapperOffsetTop,s.pagesX[n]=a.left<s.maxScrollX?s.maxScrollX:a.left*s.scale,s.pagesY[n]=a.top<s.maxScrollY?s.maxScrollY:a.top*s.scale;else if(s.options.snap){for(s.pagesX=[];a>=s.maxScrollX;)s.pagesX[l]=a,a-=s.wrapperW,l++;for(s.maxScrollX%s.wrapperW&&(s.pagesX[s.pagesX.length]=s.maxScrollX-s.pagesX[s.pagesX.length-1]+s.pagesX[s.pagesX.length-1]),a=0,l=0,s.pagesY=[];a>=s.maxScrollY;)s.pagesY[l]=a,a-=s.wrapperH,l++;s.maxScrollY%s.wrapperH&&(s.pagesY[s.pagesY.length]=s.maxScrollY-s.pagesY[s.pagesY.length-1]+s.pagesY[s.pagesY.length-1])}s._scrollbar("h"),s._scrollbar("v"),s.zoomed||(s.scroller.style[i+"TransitionDuration"]="0",s._resetPos(200))},scrollTo:function(t,e,i,n){var o,r,s=this,a=t;for(s.stop(),a.length||(a=[{x:t,y:e,time:i,relative:n}]),o=0,r=a.length;r>o;o++)a[o].relative&&(a[o].x=s.x-a[o].x,a[o].y=s.y-a[o].y),s.steps.push({x:a[o].x,y:a[o].y,time:a[o].time||0});s._startAni()},scrollToElement:function(e,i){var n,o=this;e=e.nodeType?e:o.scroller.querySelector(e),e&&(n=o._offset(e),n.left+=o.wrapperOffsetLeft,n.top+=o.wrapperOffsetTop,n.left=n.left>0?0:n.left<o.maxScrollX?o.maxScrollX:n.left,n.top=n.top>o.minScrollY?o.minScrollY:n.top<o.maxScrollY?o.maxScrollY:n.top,i=void 0===i?t.max(2*t.abs(n.left),2*t.abs(n.top)):i,o.scrollTo(n.left,n.top,i))},scrollToPage:function(t,e,i){var n,o,r=this;i=void 0===i?400:i,r.options.onScrollStart&&r.options.onScrollStart.call(r),r.options.snap?(t="next"==t?r.currPageX+1:"prev"==t?r.currPageX-1:t,e="next"==e?r.currPageY+1:"prev"==e?r.currPageY-1:e,t=0>t?0:t>r.pagesX.length-1?r.pagesX.length-1:t,e=0>e?0:e>r.pagesY.length-1?r.pagesY.length-1:e,r.currPageX=t,r.currPageY=e,n=r.pagesX[t],o=r.pagesY[e]):(n=-r.wrapperW*t,o=-r.wrapperH*e,r.maxScrollX>n&&(n=r.maxScrollX),r.maxScrollY>o&&(o=r.maxScrollY)),r.scrollTo(n,o,i)},disable:function(){this.stop(),this._resetPos(0),this.enabled=!1,this._unbind(m),this._unbind(g),this._unbind(v)},enable:function(){this.enabled=!0},stop:function(){this.options.useTransition?this._unbind("webkitTransitionEnd"):h(this.aniTime),this.steps=[],this.moved=!1,this.animating=!1},zoom:function(t,e,n,o){var r=this,s=n/r.scale;r.options.useTransform&&(r.zoomed=!0,o=void 0===o?200:o,t=t-r.wrapperOffsetLeft-r.x,e=e-r.wrapperOffsetTop-r.y,r.x=t-t*s+r.x,r.y=e-e*s+r.y,r.scale=n,r.refresh(),r.x=r.x>0?0:r.x<r.maxScrollX?r.maxScrollX:r.x,r.y=r.y>r.minScrollY?r.minScrollY:r.y<r.maxScrollY?r.maxScrollY:r.y,r.scroller.style[i+"TransitionDuration"]=o+"ms",r.scroller.style[i+"Transform"]=y+r.x+"px,"+r.y+"px"+w+" scale("+n+")",r.zoomed=!1)},isReady:function(){return!this.moved&&!this.zoomed&&!this.animating}},"undefined"!=typeof exports?exports.iScroll=E:window.iScroll=E}(),bb.menuBar={height:140,itemWidth:143,visible:!1,menu:!1,screen:!1,apply:function(t,e){bb.device.isPlayBook||bb.device.isBB10?(bb.menuBar.createSwipeMenu(t,e),t.parentNode.removeChild(t),window.blackberry&&(bb.device.isPlayBook&&blackberry.app.event?blackberry.app.event.onSwipeDown(bb.menuBar.showMenuBar):bb.device.isBB10&&blackberry.app&&blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar))):console.log("Unable to create Application/onSwipeDown menu.")},createSwipeMenu:function(t,e){bb.menuBar.screen=e;var i,n,o,r,s,a,l,b,d,c,h,u=document.createElement("div"),p=5,m=!1,g=!1,v=[];if(bb.device.is1024x600?(bb.menuBar.height=100,bb.menuBar.itemWidth=96):bb.device.is720x720?(bb.menuBar.height=110,bb.menuBar.itemWidth=143):bb.device.is1280x720?(bb.menuBar.height=116,bb.menuBar.itemWidth=113):bb.device.is1440x1440?(bb.menuBar.height=144,bb.menuBar.itemWidth=113):(bb.menuBar.height=140,bb.menuBar.itemWidth=143),u.oncontextmenu=function(t){var e=t.srcElement,i=e.parentNode;if(i)for(;i;){if(i==this){t.preventDefault();break}i=i.parentNode}},u.oncontextmenu=u.oncontextmenu.bind(u),window.addEventListener("contextmenu",u.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:u.oncontextmenu}),u.setAttribute("class","bb-menu-bar bb-menu-bar-dark"),items=t.querySelectorAll("[data-bb-type=menu-item]"),items.length>0){for(i=0,n=items.length;items.length>i;i++)r=items[i],o=r.hasAttribute("data-bb-type")?r.getAttribute("data-bb-type").toLowerCase():void 0,"menu-item"==o?(l=r.innerHTML,a=r.getAttribute("data-bb-img"),l&&a?r.hasAttribute("data-bb-pin")?(pinType=r.getAttribute("data-bb-pin").toLowerCase(),"left"!==pinType||m?"right"!==pinType||g?(console.log("Unknown value from menu-item data-bb-pin: "+pinType+" or value already defined."),v.push(r)):(g=r,p--):(m=r,p--)):v.push(r):console.log("missing menu item caption or image.")):console.log("invalid menu item type for bb10");for(v.length>=p&&(v=v.slice(0,p)),m&&v.unshift(m),g&&v.push(g),d=bb.menuBar.itemWidth+"px",c=Math.floor((window.innerWidth-bb.menuBar.itemWidth*v.length)/(v.length-1))+"px",i=0,n=v.length;n>i;i++)r=v[i],l=r.innerHTML,a=r.getAttribute("data-bb-img"),h=document.createElement("div"),h.setAttribute("class","bb-menu-bar-item"),r.innerHTML="",s=document.createElement("img"),s.setAttribute("src",a),h.appendChild(s),b=document.createElement("div"),b.setAttribute("class","bb-menu-bar-item-caption"),b.innerHTML=l,h.appendChild(b),h.onclick=r.onclick,h.style.width=d,i==v.length-1&&v.length>1||1===v.length&&!m?(h.style.marginRight=0,h.style.float="right"):h.style.marginRight=c,u.appendChild(h),h.ontouchstart=function(){this.style["border-top-color"]=bb.options.highlightColor},h.ontouchend=function(){this.style["border-top-color"]="transparent"}}else u.style.display="none",bb.menuBar.menu=null;u.addEventListener("click",bb.menuBar.onMenuBarClicked,!1),e.parentNode.appendChild(u),bb.menuBar.menu=u,bb.menuBar.menu.style["z-index"]="-100",bb.menuBar.menu.style.display="none",bb.menuBar.menu.style.height=bb.menuBar.menu.height+"px",bb.menuBar.menu.doOrientationChange=function(){var t,e,i=bb.menuBar.menu.getElementsByClassName("bb-menu-bar-item"),n=Math.floor((window.innerWidth-bb.menuBar.itemWidth*i.length)/(i.length-1))+"px";for(t=0,e=i.length;e>t;t++)t==i.length-1?(i[t].style.marginRight=0,i[t].style.float="right"):i[t].style.marginRight=n},bb.menuBar.menu.doOrientationChange=bb.menuBar.menu.doOrientationChange.bind(bb.menuBar),window.addEventListener("resize",bb.menuBar.menu.doOrientationChange,!1),bb.windowListeners.push({name:"resize",eventHandler:bb.menuBar.menu.doOrientationChange}),bb.screen.overlay||(bb.screen.overlay=document.createElement("div"),bb.screen.overlay.setAttribute("class","bb-menu-bar-overlay")),e.appendChild(bb.screen.overlay),bb.menuBar.menu.overlay=bb.screen.overlay},doEndTransition:function(){bb.menuBar.visible?bb.menuBar.menu.style["z-index"]="":(bb.menuBar.menu.style!==void 0&&(bb.menuBar.menu.style.display="none",bb.menuBar.menu.style.height="0px"),bb.menuBar.screen.removeEventListener("webkitTransitionEnd",bb.menuBar.doEndTransition),bb.menuBar.screen.style["-webkit-transition"]="",bb.menuBar.screen.style["-webkit-transform"]="",bb.menuBar.screen.style["-webkit-backface-visibility"]="")},setDimensions:function(){bb.menuBar.menu.style.display="",bb.menuBar.menu.style.height=bb.menuBar.height+"px",bb.menuBar.screen.parentNode.style.position="absolute",bb.menuBar.screen.parentNode.style.left="0px",bb.menuBar.screen.parentNode.style.top="0px",bb.menuBar.screen.parentNode.style.bottom="0px",bb.menuBar.screen.parentNode.style.right="0px",bb.menuBar.screen.parentNode.style.width="100%",bb.menuBar.screen.parentNode.style.overflow="hidden",bb.menuBar.menu.overlay.style.display="block",bb.menuBar.screen.style["-webkit-transition"]="0.2s ease-out",bb.menuBar.screen.style["-webkit-transform"]="translate3d(0px,"+bb.menuBar.height+"px,0px)",bb.menuBar.screen.style["-webkit-backface-visibility"]="hidden"},showMenuBar:function(){bb.menuBar.visible||bb.screen.animating||(bb.menuBar.visible=!0,bb.device.isPlayBook?blackberry.app.event.onSwipeDown(bb.menuBar.hideMenuBar):bb.device.isBB10&&(blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar),blackberry.event.addEventListener("swipedown",bb.menuBar.hideMenuBar)),bb.device.isBB10?(bb.menuBar.screen.addEventListener("webkitTransitionEnd",bb.menuBar.doEndTransition),bb.menuBar.setDimensions()):bb.device.isPlayBook&&(bb.menuBar.menu.style["-webkit-transition"]="all 0.5s ease-in-out",bb.menuBar.menu.style["-webkit-transform"]="translate3d(0, "+(bb.menuBar.height+3)+"px,0px)"),bb.menuBar.visible=!0,bb.menuBar.menu.overlay.addEventListener("touchstart",bb.menuBar.overlayTouchHandler,!1))},hideMenuBar:function(){bb.menuBar.visible&&(bb.menuBar.visible=!1,bb.device.isPlayBook?blackberry.app.event.onSwipeDown(bb.menuBar.showMenuBar):bb.device.isBB10&&(blackberry.event.removeEventListener("swipedown",bb.menuBar.hideMenuBar),blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)),bb.device.isBB10?(bb.menuBar.menu.style["z-index"]="-100",bb.menuBar.screen.style["-webkit-transform"]="translate3d(0px,0px,0px)",bb.menuBar.menu.overlay.style.display="none"):bb.device.isPlayBook&&(bb.menuBar.menu.style["-webkit-transition"]="all 0.5s ease-in-out",bb.menuBar.menu.style["-webkit-transform"]="translate3d(0, -"+(bb.menuBar.height+3)+"px,0px)"),bb.menuBar.menu.overlay.removeEventListener("touchstart",bb.menuBar.overlayTouchHandler,!1))},overlayTouchHandler:function(t){t.preventDefault(),t.stopPropagation(),bb.menuBar.hideMenuBar()},onMenuBarClicked:function(){bb.menuBar.hideMenuBar()},clearMenu:function(){window.blackberry&&bb.menuBar.menu&&(bb.device.isPlayBook||bb.device.isBB10)&&(bb.menuBar.visible&&bb.menuBar.hideMenuBar(),bb.device.isPlayBook&&blackberry.app.event?blackberry.app.event.onSwipeDown(""):bb.device.isBB10&&blackberry.app&&(blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar),blackberry.event.removeEventListener("swipedown",bb.menuBar.hideMenuBar)),bb.menuBar.menu.parentNode.removeChild(bb.menuBar.menu),bb.menuBar.menu=!1,bb.menuBar.visible=!1)}},_bb_progress={NORMAL:0,PAUSED:1,ERROR:2,apply:function(t){for(var e=0;t.length>e;e++)bb.progress.style(t[e],!0)},style:function(t,e){var i=bb.screen.controlColor,n=bb.options.highlightColor,o=bb.options.shades.darkHighlight;return outerElement=document.createElement("div"),outerElement.progress=t,outerElement.state=bb.progress.NORMAL,t.parentNode&&t.parentNode.insertBefore(outerElement,t),t.style.display="none",outerElement.appendChild(t),outerElement.maxValue=t.hasAttribute("max")?parseInt(t.getAttribute("max")):0,outerElement.value=t.hasAttribute("value")?parseInt(t.getAttribute("value")):0,outerElement.className="bb-progress",outerElement.outer=document.createElement("div"),bb.device.newerThan10dot2===!0?outerElement.outer.setAttribute("class","outer outer-10dot3 bb-progress-outer-10dot3-"+i+" bb-progress-outer-idle-background-"+i):outerElement.outer.setAttribute("class","outer bb-progress-outer-"+i+" bb-progress-outer-idle-background-"+i),outerElement.appendChild(outerElement.outer),outerElement.fill=document.createElement("div"),outerElement.fill.normal=bb.device.newerThan10dot2===!0?"bb-progress-fill bb-progress-fill-10dot3 bb10Highlight":"bb-progress-fill bb10Highlight",outerElement.fill.setAttribute("class",outerElement.fill.normal),outerElement.outer.appendChild(outerElement.fill),outerElement.inner=document.createElement("div"),outerElement.inner.className="inner",outerElement.outer.appendChild(outerElement.inner),t.outerElement=outerElement,t.setValue=function(t){var e,r=0;t&&0>t||t&&t>parseInt(this.outerElement.maxValue)||(t?(this.outerElement.value=t,this.value=t):0==t?(this.outerElement.value=0,this.value=0):t=parseInt(this.outerElement.value),t==this.outerElement.maxValue?(this.outerElement.fill.style.background="-webkit-gradient(linear, center top, center bottom, from("+o+"), to("+n+"))",r=1):0==t?bb.device.newerThan10dot2===!0?this.outerElement.outer.setAttribute("class","outer outer-10dot3 bb-progress-outer-10dot3-"+i+" bb-progress-outer-idle-background-"+i):this.outerElement.outer.setAttribute("class","outer bb-progress-outer-"+i+" bb-progress-outer-idle-background-"+i):(this.outerElement.state==bb.progress.PAUSED?this.outerElement.fill.style.background="-webkit-gradient(linear, center top, center bottom, from(#EDC842), to(#BA991E))":this.outerElement.state==bb.progress.ERROR?this.outerElement.fill.style.background="-webkit-gradient(linear, center top, center bottom, from( #E04242), to(#D91111))":(bb.device.newerThan10dot2===!0?this.outerElement.outer.setAttribute("class","outer outer-10dot3 bb-progress-outer-10dot3-"+i):this.outerElement.outer.setAttribute("class","outer bb-progress-outer-"+i),this.outerElement.fill.setAttribute("class",this.outerElement.fill.normal),this.outerElement.fill.style.background=""),r=this.outerElement.value/parseInt(this.outerElement.maxValue)),e=Math.floor(parseInt(window.getComputedStyle(this.outerElement.outer).width)*r),this.outerElement.fill.style.width=e+"px")},t.setValue=t.setValue.bind(t),t.setState=function(t){this.outerElement.state=t,this.setValue()},t.setState=t.setState.bind(t),t.show=function(){this.outerElement.style.display="block",bb.refresh()},t.show=t.show.bind(t),t.hide=function(){this.outerElement.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.outerElement.parentNode.removeChild(this.outerElement),bb.refresh()},t.remove=t.remove.bind(t),t.setMax=function(t){!t||0>t||t==this.max||(this.max=t,this.outerElement.maxValue=t)},t.setMax=t.setMax.bind(t),e?(t.onbbuidomready=function(){this.setValue(),document.removeEventListener("bbuidomready",this.onbbuidomready,!1)},t.onbbuidomready=t.onbbuidomready.bind(t),document.addEventListener("bbuidomready",t.onbbuidomready,!1)):window.setTimeout(t.setValue,0),outerElement.doOrientationChange=function(){window.setTimeout(this.progress.setValue,0)},outerElement.doOrientationChange=outerElement.doOrientationChange.bind(outerElement),window.addEventListener("resize",outerElement.doOrientationChange,!1),bb.windowListeners.push({name:"resize",eventHandler:outerElement.doOrientationChange}),outerElement
}},bb.screen={scriptCounter:0,totalScripts:0,controlColor:"light",listColor:"light",overlay:null,tabOverlay:null,contextMenu:null,currentScreen:null,focusedInput:null,animating:!1,apply:function(t){var e;bb.screen.contextMenu=null;for(var i=0;t.length>i;i++){e=t[i],bb.screen.currentScreen=e,e.setAttribute("class","bb-screen");var n,o,r,s=e.querySelectorAll("[data-bb-type=menu]"),a=e.querySelectorAll("[data-bb-type=title]"),l=e.querySelectorAll("[data-bb-type=action-bar]"),b=e.querySelectorAll("[data-bb-type=context-menu]"),d=[],c=null,h=bb.screen.getMenuBarHeight(),u=bb.screen.getActionBarHeight(),p=bb.screen.getTitleBarHeight();for(s.length>0?(s=s[0],e.menuBar=s):s=null,a.length>0?(a=a[0],e.titleBar=a):a=null,l.length>0?(l=l[0],e.actionBar=l):l=null,n=document.createElement("div"),e.appendChild(n),e.hasAttribute("data-bb-scroll-effect")&&"off"==e.getAttribute("data-bb-scroll-effect").toLowerCase()||(e.bbUIscrollWrapper=n),o=document.createElement("div"),n.appendChild(o),r=0;e.childNodes.length-1>r;r++)c=e.childNodes[r],c!=l&&c!=s&&c!=a&&d.push(c);for(r=0;d.length>r;r++)o.appendChild(d[r]);if(e.menuBarHeight=h,e.actionBarHeight=u,e.titleBarHeight=p,e.outerScrollArea=n,n.addEventListener("scroll",function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt),bb.device.requiresScrollingHack&&(this.timeout?clearTimeout(this.timeout):this.style["padding-right"]="1px",this.timeout=setTimeout(this.resetPadding,20))},!1),n.resetPadding=function(){this.style["padding-right"]="0px",this.timeout=null},n.resetPadding=n.resetPadding.bind(n),e.getAttribute("data-bb-indicator")){var m=document.createElement("div"),g=document.createElement("div");n.scrollArea=o,n.overlay=m,m.style.position="absolute",m.style.bottom="0px",m.style.top="0px",m.style.left="0px",m.style.right="0px",m.touchstart=function(t){t.preventDefault(),t.stopPropagation()},m.touchend=function(t){t.preventDefault(),t.stopPropagation()},m.click=function(t){t.preventDefault(),t.stopPropagation()},n.appendChild(m),o.style.display="none",g.setAttribute("data-bb-type","activity-indicator"),g.setAttribute("data-bb-size","large"),g.style.margin=bb.device.is720x720?"30% auto 0px auto":"landscape"==bb.getOrientation().toLowerCase()?"20% auto 0px auto":"60% auto 0px auto",m.appendChild(g),n.bbuidomprocessed=function(){this.scrollArea.style.display="",this.removeChild(this.overlay),document.removeEventListener("bbuidomprocessed",this.bbuidomprocessed,!1),bb.device.isPlayBook&&bb.scroller&&bb.scroller.refresh()},n.bbuidomprocessed=n.bbuidomprocessed.bind(n),document.addEventListener("bbuidomprocessed",n.bbuidomprocessed,!1)}a&&l?(n.style.overflow="auto",n.style.position="absolute",n.style.bottom=u+"px",n.style.top=p+"px",n.style.left="0px",n.style.right="0px"):a?(n.style.overflow="auto",n.style.position="absolute",n.style.bottom="0px",n.style.top=p+"px",n.style.left="0px",n.style.right="0px"):l?(n.style.overflow="auto",n.style.position="absolute",n.style.bottom=u+"px",n.style.top="0px",n.style.left="0px",n.style.right="0px"):(n.setAttribute("style","overflow:auto;bottom:0px;position:absolute;top:0px;left:0px;right:0px;"),n.style.overflow="auto",n.style.position="absolute",n.style.bottom="0px",n.style.top="0px",n.style.left="0px",n.style.right="0px"),s&&bb.menuBar.apply(s,e),a&&bb.titleBar.apply(a),l&&(bb.device.newerThan10dot2===!0?bb.actionBar10dot3.apply(l,e):bb.actionBar.apply(l,e)),b.length>0?bb.screen.processContext(b[0],e):b=null,e.refresh=function(){bb.scroller&&bb.scroller.refresh()},e.refresh=e.refresh.bind(e),e.scrollTo=function(t,e){bb.scroller?bb.scroller.scrollTo(t,e):bb.device.isBB10&&(this.bbUIscrollWrapper.scrollTop=t)},e.scrollTo=e.scrollTo.bind(e),e.scrollToElement=function(t){if(bb.scroller)bb.scroller.scrollToElement(t);else if(bb.device.isBB10){if(!t)return;var e=0,i=t;if(i.offsetParent)do e+=i.offsetTop;while(i=i.offsetParent);bb.screen.currentScreen.titleBar&&(e-=bb.screen.currentScreen.titleBarHeight),bb.screen.currentScreen.actionBar&&(e-=bb.screen.getActionBarHeight()),this.scrollTo(e)}},e.scrollToElement=e.scrollToElement.bind(e)}},processContext:function(t,e){bb.device.isPlayBook||bb.device.isRipple||blackberry.ui&&blackberry.ui.contextmenu&&(blackberry.ui.contextmenu.enabled=!0),e.appendChild(t),t.menu=bb.contextMenu.create(e),t.appendChild(t.menu),bb.screen.contextMenu=t.menu;var i,n=t.querySelectorAll("[data-bb-type=action]");for(i=0;n.length>i;i++)t.menu.add(n[i]);t.menu.centerMenuItems()},fadeIn:function(t){var e=.3,i="ease-out",n=t.style;n["-webkit-animation-name"]="bbUI-fade-in",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},fadeOut:function(t){var e=.3,i="ease-out",n=t.style;n["-webkit-animation-name"]="bbUI-fade-out",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideLeft:function(t){var e=.2,i="ease-out",n=t.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-left",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutLeft:function(t){var e=.3,i="ease-out",n=t.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-out-left",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideRight:function(t){var e=.3,i="ease-out",n=t.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-right",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutRight:function(t){var e=.3,i="ease-out",n=t.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-out-right",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideUp:function(t){var e=.3,i="ease-out",n=t.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-up",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutUp:function(t){var e=.3,i="ease-out",n=t.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-out-up",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideDown:function(t){var e=.3,i="ease-out",n=t.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-down",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutDown:function(t){var e=.3,i="ease-out",n=t.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-out-down",n["-webkit-animation-duration"]=e+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},getMenuBarHeight:function(){return bb.device.is1024x600?"portrait"==bb.getOrientation().toLowerCase()?73:73:bb.device.is1280x768||bb.device.is1280x720?"portrait"==bb.getOrientation().toLowerCase()?140:111:"portrait"==bb.getOrientation().toLowerCase()?140:111},getActionBarHeight:function(){return bb.device.is1024x600?"portrait"==bb.getOrientation().toLowerCase()?73:73:bb.device.is1280x768?bb.device.newerThan10dot2===!0?120:"portrait"==bb.getOrientation().toLowerCase()?139:99:bb.device.is1280x720?bb.device.newerThan10dot2===!0?96:"portrait"==bb.getOrientation().toLowerCase()?116:92:bb.device.is720x720?109:bb.device.is1440x1440?144:"portrait"==bb.getOrientation().toLowerCase()?139:99},getTitleBarHeight:function(){return bb.device.is1024x600?65:bb.device.is1280x768?111:bb.device.is1280x720?bb.device.newerThan10dot2?88:111:bb.device.is720x720?bb.device.newerThan10dot2?90:92:bb.device.is1440x1440?132:bb.device.newerThan10dot2?110:111}},bb.tabOverflow={create:function(t){var e,i=document.createElement("div");return i.screen=t,i.itemClicked=!1,i.visible=!1,i.actions=[],i.tabOverflowState={display:void 0,img:void 0,style:void 0,caption:void 0},i.setAttribute("class","bb-tab-overflow-menu bb-tab-overflow-menu-dark"),t.parentNode.appendChild(i),i.style["z-index"]="-100",i.style.display="none",i.style.width=i.width+"px",i.oncontextmenu=function(t){var e=t.srcElement,i=e.parentNode;if(i)for(;i;){if(i==this){t.preventDefault();break}i=i.parentNode}},i.oncontextmenu=i.oncontextmenu.bind(i),window.addEventListener("contextmenu",i.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:i.oncontextmenu}),bb.screen.tabOverlay||(e=document.createElement("div"),e.menu=i,bb.screen.tabOverlay=e,e.setAttribute("class","bb-tab-overflow-menu-overlay "),t.appendChild(e),e.ontouchstart=function(t){t.preventDefault(),t.stopPropagation(),this.menu.hide()}),i.overlay=bb.screen.tabOverlay,i.doEndTransition=function(){this.visible?this.style["z-index"]="":(this.style.display="none",this.style.width="0px",this.screen.removeEventListener("webkitTransitionEnd",i.doEndTransition),this.screen.style["-webkit-transition"]="",this.screen.style["-webkit-transform"]="",this.screen.style["-webkit-backface-visibility"]="")},i.doEndTransition=i.doEndTransition.bind(i),i.show=function(){this.itemClicked=!1,this.visible=!0;var t=this.actionBar.tabOverflowBtn;bb.device.newerThan10dot2===!1&&(this.tabOverflowState.display=t.tabHighlight.style.display,this.tabOverflowState.img=t.icon.src,this.tabOverflowState.caption=t.display.innerHTML,this.tabOverflowState.style=t.icon.getAttribute("class")),this.screen.addEventListener("webkitTransitionEnd",i.doEndTransition),this.setDimensions(),t.reset(),bb.device.isPlayBook?blackberry.app.event.onSwipeDown():blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar)},i.show=i.show.bind(i),i.setDimensions=function(){this.style.display="",this.style.width=bb.tabOverflow.getWidth()+"px",this.screen.parentNode.style.position="absolute",this.screen.parentNode.style.left="0px",this.screen.parentNode.style.top="0px",this.screen.parentNode.style.bottom="0px",this.screen.parentNode.style.right="0px",this.screen.parentNode.style.width="100%",this.screen.parentNode.style.overflow="hidden",this.overlay.style.display="block",this.screen.style["-webkit-transition"]="0.2s ease-out",this.screen.style["-webkit-transform"]="translate3d("+bb.tabOverflow.getWidth()+"px,0px,0px)",this.screen.style["-webkit-backface-visibility"]="hidden"},i.setDimensions=i.setDimensions.bind(i),i.hide=function(){if(this.visible=!1,this.style["z-index"]="-100",this.screen.style["-webkit-transform"]="translate3d(0px,0px,0px)",this.overlay.style.display="none",bb.device.newerThan10dot2===!1&&!this.itemClicked){var t=this.actionBar.tabOverflowBtn;t.icon.setAttribute("src",this.tabOverflowState.img),t.icon.setAttribute("class",this.tabOverflowState.style),t.tabHighlight.style.display=this.tabOverflowState.display,t.display.innerHTML=this.tabOverflowState.caption}bb.device.isPlayBook?blackberry.app.event.onSwipeDown(bb.menuBar.showMenuBar):blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)},i.hide=i.hide.bind(i),i.onclick=function(){this.hide()},i.centerMenuItems=function(){var t,e=bb.innerHeight(),i=111;i=bb.device.is1024x600?53:bb.device.is720x720?80:bb.device.is1280x720?91:bb.device.is1440x1440?132:111,t=e-Math.floor(e/2)-Math.floor(this.actions.length*i/2),0>t&&(t=0),this.actions[0].style["margin-top"]=t+"px"},i.centerMenuItems=i.centerMenuItems.bind(i),i.initSelected=function(){var t,e;for(t=0;this.actions.length>t;t++)if(e=this.actions[t],e.initialSelected){e.setOverflowTab(!0);break}},i.initSelected=i.initSelected.bind(i),i.orientationChanged=function(){this.centerMenuItems(),this.visible&&this.setDimensions()},i.orientationChanged=i.orientationChanged.bind(i),window.addEventListener("orientationchange",i.orientationChanged,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:i.orientationChanged}),i.add=function(t){var e,i,n,o,r=t.innerHTML,s=t.getAttribute("data-bb-accent-text"),a=document.createElement("div"),l="bb-tab-overflow-menu-item-inner",b=document.createElement("img");e="bb-tab-overflow-menu-item bb-tab-overflow-menu-item-dark",this.appendChild(t),t.hasAttribute("data-bb-visible")&&"false"==t.getAttribute("data-bb-visible").toLowerCase()?(t.visible=!1,t.style.display="none"):(t.visible=!0,this.actions.push(t)),1==this.actions.length&&(e+=" bb-tab-overflow-menu-item-first-dark"),t.normal=e,t.accentText=null,t.menu=this,t.caption=r,t.setAttribute("class",t.normal),t.innerHTML="",t.visibleTab||(t.visibleTab=t.actionBar.tabOverflowBtn),i=document.createElement("table"),n=document.createElement("tr"),i.appendChild(n),t.appendChild(i),o=document.createElement("td"),b.setAttribute("src",t.getAttribute("data-bb-img")),b.setAttribute("class","bb-tab-overflow-menu-item-image"),t.img=b,o.appendChild(b),n.appendChild(o),o=document.createElement("td"),a.innerHTML=r,t.display=a,o.appendChild(a),s?(t.accentText=document.createElement("div"),t.accentText.innerHTML=s,t.accentText.setAttribute("class","tab-accent-text"),o.appendChild(t.accentText),l+=" bb-tab-overflow-menu-item-double"):l+=" bb-tab-overflow-menu-item-single",a.setAttribute("class",l),n.appendChild(o),t.setOverflowTab=function(t){var e=this.actionBar.tabOverflowBtn;t&&(bb.device.newerThan10dot2===!0?bb.actionBar10dot3.highlightAction(this.visibleTab,this):bb.actionBar.highlightAction(this.visibleTab,this)),this.visibleTab==e&&bb.device.newerThan10dot2===!1&&(e.icon.setAttribute("src",this.img.src),e.icon.setAttribute("class",e.icon.highlight),e.tabHighlight.style.display="block",e.display.innerHTML=this.caption)},t.setOverflowTab=t.setOverflowTab.bind(t),t.initialSelected=t.hasAttribute("data-bb-selected")&&"true"==t.getAttribute("data-bb-selected").toLowerCase(),t.selected=t.initialSelected,t.oldClick=t.onclick,t.onclick=function(){var t=this.actionBar.tabOverflowBtn;this.menu.itemClicked=!0,bb.device.newerThan10dot2===!0?bb.actionBar10dot3.highlightAction(this.visibleTab,this):bb.actionBar.highlightAction(this.visibleTab,this),this.visibleTab==t&&this.setOverflowTab(!1),this.oldClick&&this.oldClick()},t.setCaption=function(t){this.display.innerHTML=t,this.caption=t;var e=this.actionBar.tabOverflowBtn;this.visibleTab==e&&1==this.selected&&(e.display.innerHTML=this.caption)},t.setCaption=t.setCaption.bind(t),t.setImage=function(t){this.img.setAttribute("src",t)},t.setImage=t.setImage.bind(t),t.show=function(){this.visible||(this.visible=!0,this.menu.actions.push(this),this.style.display="",this.menu.centerMenuItems())},t.show=t.show.bind(t),t.hide=function(){if(this.visible){this.visible=!1;var t=this.menu.actions.indexOf(this);this.menu.actions.splice(t,1),this.style.display="none",this.menu.centerMenuItems()}},t.hide=t.hide.bind(t)},i.add=i.add.bind(i),i},getWidth:function(){return bb.device.is1024x600?"portrait"==bb.getOrientation()?bb.innerWidth()-77:400:bb.device.is720x720?550:bb.device.is1280x720?488:bb.device.is1440x1440?732:"portrait"==bb.getOrientation()?bb.innerWidth()-154:700}},bb.titleBar={apply:function(titleBar){var orientation=bb.getOrientation(),button,caption,titleBarClass,details,topTitleArea=document.createElement("div"),img,accentText;titleBar.topTitleArea=topTitleArea,titleBar.appendChild(topTitleArea),bb.device.newerThan10dot2===!1&&titleBar.parentNode&&(titleBar.dropShadow=document.createElement("div"),titleBar.dropShadow.setAttribute("class","bb-title-bar-drop-shadow"),titleBar.dropShadow.style.top=bb.screen.getTitleBarHeight()-1+"px",titleBar.parentNode.appendChild(titleBar.dropShadow)),bb.options.coloredTitleBar?bb.device.newerThan10dot2===!0?(titleBarClass="bb-title-bar bb-title-bar-10dot3 bb-title-bar-10dot3-"+orientation+" bb10-title-10dot3-colored",topTitleArea.style["border-bottom-color"]=bb.options.highlightColor):titleBarClass="bb-title-bar bb-title-bar-"+orientation+" bb10-title-colored":bb.device.newerThan10dot2===!0?(titleBarClass="bb-title-bar bb-title-bar-10dot3 bb-title-bar-10dot3-"+orientation+" bb-title-bar-10dot3-"+bb.screen.controlColor,topTitleArea.style["border-bottom-color"]=bb.options.highlightColor):titleBarClass="bb-title-bar bb-title-bar-"+orientation+" bb-title-bar-"+bb.screen.controlColor,topTitleArea.setAttribute("class",titleBarClass),caption=document.createElement("div"),titleBar.caption=caption,caption.setAttribute("class","bb-title-bar-caption bb-title-bar-caption-"+orientation),caption.innerHTML=titleBar.getAttribute("data-bb-caption"),topTitleArea.appendChild(caption),titleBar.hasAttribute("data-bb-back-caption")&&(button=document.createElement("div"),button.innerHTML=titleBar.getAttribute("data-bb-back-caption"),topTitleArea.appendChild(button),titleBar.backButton=button,button.onclick=bb.popScreen,bb.titleBar.styleBB10Button(button),button.style.left="0px",button.innerElement.style["border-right-width"]="2px",button.innerElement.style["border-right-style"]="solid",button.borderSide="right",bb.options.coloredTitleBar||(button.innerElement.style.color=bb.options.highlightColor)),titleBar.hasAttribute("data-bb-action-caption")&&(button=document.createElement("div"),button.innerHTML=titleBar.getAttribute("data-bb-action-caption"),titleBar.hasAttribute("onactionclick")?(button.titleBar=titleBar,button.onactionclick=titleBar.getAttribute("onactionclick"),titleBar.onactionclick=function(){eval(this.actionButton.onactionclick)},button.onclick=function(){this.titleBar.onactionclick&&this.titleBar.onactionclick()}):titleBar.onactionclick&&(button.onclick=titleBar.onactionclick),bb.titleBar.styleBB10Button(button),button.style.right="0px",topTitleArea.appendChild(button),titleBar.actionButton=button,button.innerElement.style["border-left-width"]="2px ",button.innerElement.style["border-left-style"]="solid",button.borderSide="left",bb.options.coloredTitleBar||(button.innerElement.style.color=bb.options.highlightColor)),(titleBar.actionButton||titleBar.backButton)&&(titleBar.evenButtonWidths=function(){var t,e=this.backButton?parseInt(window.getComputedStyle(this.backButton).width):0,i=this.actionButton?parseInt(window.getComputedStyle(this.actionButton).width):0;this.actionButton&&this.backButton?(t=e>i?e:i,this.backButton.style.width=t+"px",this.actionButton.style.width=t+"px",this.caption.style["margin-left"]=t+24+"px",this.caption.style["margin-right"]=t+24+"px"):this.actionButton?(this.caption.style["margin-left"]="0px",this.caption.style["margin-left"]=i+24+"px",this.caption.style["margin-right"]=i+24+"px"):this.backButton&&(this.caption.style["margin-right"]="0px",this.caption.style["margin-left"]=e+24+"px",this.caption.style["margin-right"]=e+24+"px")},titleBar.evenButtonWidths=titleBar.evenButtonWidths.bind(titleBar),window.setTimeout(titleBar.evenButtonWidths,0)),titleBar.actionButton||titleBar.backButton||!titleBar.hasAttribute("data-bb-img")&&!titleBar.hasAttribute("data-bb-accent-text")||(caption.setAttribute("class","bb-title-bar-caption-left"),details=document.createElement("div"),titleBar.details=details,topTitleArea.appendChild(details),details.appendChild(caption),titleBar.hasAttribute("data-bb-img")&&(img=document.createElement("img"),titleBar.img=img,topTitleArea.insertBefore(img,details),bb.device.newerThan10dot2===!0?details.setAttribute("class","bb-title-bar-caption-details-img-10dot3"):details.setAttribute("class","bb-title-bar-caption-details-img"),img.style.opacity="0",img.style["-webkit-transition"]="opacity 0.5s linear",img.style["-webkit-backface-visibility"]="hidden",img.style["-webkit-perspective"]=1e3,img.style["-webkit-transform"]="translate3d(0,0,0)",titleBar.onbbuidomready=function(){this.img.onload=function(){this.style.opacity="1.0"},this.img.src=this.getAttribute("data-bb-img"),document.removeEventListener("bbuidomready",this.onbbuidomready,!1)},titleBar.onbbuidomready=titleBar.onbbuidomready.bind(titleBar),document.addEventListener("bbuidomready",titleBar.onbbuidomready,!1)),titleBar.hasAttribute("data-bb-accent-text")&&(caption.style["line-height"]=bb.device.is1024x600?"40px":bb.device.is1280x768?"70px":bb.device.is1280x720?bb.device.newerThan10dot2===!0?"55px":"70px":bb.device.is720x720?bb.device.newerThan10dot2===!0?"40px":"55px":bb.device.is1440x1440?"80px":bb.device.newerThan10dot2===!0?"54px":"70px",accentText=document.createElement("div"),bb.device.newerThan10dot2===!0?accentText.setAttribute("class","bb-title-bar-accent-text bb-title-bar-accent-text-10dot3"):accentText.setAttribute("class","bb-title-bar-accent-text"),bb.options.coloredTitleBar&&(accentText.style.color="silver"),titleBar.accentText=accentText,accentText.innerHTML=titleBar.getAttribute("data-bb-accent-text"),details.appendChild(accentText))),titleBar.setCaption=function(t){this.caption.innerHTML=t},titleBar.setCaption=titleBar.setCaption.bind(titleBar),titleBar.getCaption=function(){return this.caption.innerHTML},titleBar.getCaption=titleBar.getCaption.bind(titleBar),titleBar.setBackCaption=function(t){this.backButton.firstChild.innerHTML=t,this.actionButton&&(this.backButton.style.width="",this.evenButtonWidths())},titleBar.setBackCaption=titleBar.setBackCaption.bind(titleBar),titleBar.getBackCaption=function(){return this.backButton.firstChild.innerHTML},titleBar.getBackCaption=titleBar.getBackCaption.bind(titleBar),titleBar.setActionCaption=function(t){this.actionButton.firstChild.innerHTML=t,this.backButton&&(this.actionButton.style.width="",this.evenButtonWidths())},titleBar.setActionCaption=titleBar.setActionCaption.bind(titleBar),titleBar.getActionCaption=function(){return this.actionButton.firstChild.innerHTML},titleBar.getActionCaption=titleBar.getActionCaption.bind(titleBar),titleBar.getAccentText=function(){return this.accentText.innerHTML},titleBar.getAccentText=titleBar.getAccentText.bind(titleBar)},styleBB10Button:function(t){var e,i,n,o=document.createElement("div");bb.options.coloredTitleBar?bb.device.newerThan10dot2===!0?(e="bb-titlebar-button bb-titlebar-button-10dot3 bb10-title-button-10dot3-colored",i="bb-titlebar-button-container-10dot3 bb10-title-button-10dot3-colored-highlight",n="bb-titlebar-button-container-10dot3 bb10-title-button-container-10dot3-colored",o.style["border-style"]="none"):(e="bb-titlebar-button bb10-title-button-colored",i="bb-titlebar-button bb10-title-button-colored-highlight",n="bb-titlebar-button-container bb10-title-button-container-colored"):bb.device.newerThan10dot2===!0?(e="bb-titlebar-button bb-titlebar-button-10dot3 bb-titlebar-button-10dot3-"+bb.screen.controlColor,i="bb-titlebar-button-container-10dot3 bb-titlebar-button-container-10dot3-"+bb.screen.controlColor+" bb-titlebar-button-highlight-10dot3-"+bb.screen.controlColor,n="bb-titlebar-button-container-10dot3 bb-titlebar-button-container-10dot3-"+bb.screen.controlColor):(e="bb-titlebar-button bb-titlebar-button-"+bb.screen.controlColor,i="bb-titlebar-button bb-titlebar-button-highlight-"+bb.screen.controlColor,n="bb-titlebar-button-container bb-titlebar-button-container-"+bb.screen.controlColor),bb.device.is10dot2&&(n+=" bb-titlebar-button-container-10dot2"),t.enabled=!0,o.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(o),o.setAttribute("class",e),t.setAttribute("class",n),t.outerNormal=n,t.innerElement=o,o.normal=e,o.highlight=i,t.ontouchstart=function(){bb.device.newerThan10dot2===!0?(this.setAttribute("class",this.innerElement.highlight),this.innerElement.style["border-"+this.borderSide+"-width"]="0px"):this.innerElement.setAttribute("class",this.innerElement.highlight)},t.ontouchend=function(){bb.device.newerThan10dot2===!0?(this.setAttribute("class",this.outerNormal),this.innerElement.style["border-"+this.borderSide+"-width"]="2px"):this.innerElement.setAttribute("class",this.innerElement.normal)},t.trappedClick=t.onclick,t.onclick=void 0,null!==t.trappedClick&&t.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1)}},_bb10_activityIndicator={apply:function(t){var e,i,n,o,r,s,a,l=bb.screen.controlColor;if(!bb.device.newerThan10dot1&&t.length>0){var b,d,c=document.createElement("canvas");c.setAttribute("height","184px"),c.setAttribute("width","184px"),b=c.getContext("2d"),b.beginPath(),b.moveTo(92,154),b.arcTo(154,154,154,92,62),b.arcTo(154,30,92,30,62),b.arcTo(81,30,81,20,10),b.arcTo(81,10,91,10,10),b.arcTo(173,10,173,92,82),b.arcTo(173,173,92,173,82),b.arcTo(81,173,81,164,10),b.arcTo(81,154,92,154,10),b.closePath(),b.strokeStyle="transparent",b.stroke();var d=b.createLinearGradient(0,50,0,154);d.addColorStop(0,"transparent"),d.addColorStop(1,bb.options.highlightColor),b.fillStyle=d,b.fill(),a=c.toDataURL()}for(e=0;t.length>e;e++)i=t[e],r=i.hasAttribute("data-bb-size")?i.getAttribute("data-bb-size").toLowerCase():"medium","large"==r?s=bb.device.is1024x600?"93px":bb.device.is1280x768?"184px":bb.device.is1280x720?"135px":bb.device.is720x720?"170px":bb.device.is1440x1440?"300px":"184px":"small"==r?s=bb.device.is1024x600?"21px":bb.device.is1280x768?"41px":bb.device.is1280x720?"35px":bb.device.is1440x1440?"60px":"41px":(r="medium",s=bb.device.is1024x600?"46px":bb.device.is1280x768?"93px":bb.device.is1280x720?"69px":bb.device.is720x720?"88px":bb.device.is1440x1440?"150px":"93px"),i.style.width=s,o=document.createElement("div"),bb.device.newerThan10dot1?(o.setAttribute("class","bb-activity-margin bb-activity-"+r),i.appendChild(o),n=document.createElement("div"),n.setAttribute("class","bb-activity-"+r+" bb-activity-"+l+"-10dot2"),o.appendChild(n)):(o.setAttribute("class","bb-activity-margin bb-activity-"+r+" bb-activity-"+l),i.appendChild(o),n=document.createElement("div"),n.setAttribute("class","bb-activity-"+r),n.style["background-image"]='url("'+a+'")',o.appendChild(n)),n.style["-webkit-animation-name"]="activity-rotate",n.style["-webkit-animation-duration"]="0.8s",n.style["-webkit-animation-iteration-count"]="infinite",n.style["-webkit-animation-timing-function"]="linear",i.show=function(){this.style.display="",bb.refresh()},i.show=i.show.bind(i),i.hide=function(){this.style.display="none",bb.refresh()},i.hide=i.hide.bind(i),i.remove=function(){this.parentNode.removeChild(this),bb.refresh()},i.remove=i.remove.bind(i)}},_bb10_button={apply:function(t){for(var e=0;t.length>e;e++)bb.button.style(t[e])},style:function(t){var e,i,n,o,r,s,a=document.createElement("div"),l=document.createElement("div");if(disabled=t.hasAttribute("data-bb-disabled"),normal="bb-button",outerNormal="bb-button-container bb-button-container-"+bb.screen.controlColor,bb.device.newerThan10dot2?(normal+=" bb-button-10dot3 bb-button-"+bb.screen.controlColor+"-10dot3",outerNormal+=" bb-button-container-10dot3",s="bb-button bb-button-10dot3 bb-button-"+bb.screen.controlColor+" bb-button-"+bb.screen.controlColor+"-highlight-10dot3"):bb.device.newerThan10dot1?(normal+=" bb-button-10dot2",outerNormal+=" bb-button-container-10dot2",s="bb-button bb-button-10dot2 bb-button-"+bb.screen.controlColor+" bb-button-"+bb.screen.controlColor+"-highlight-10dot2"):s="bb-button bb10-button-highlight",r=outerNormal,t.isImageOnly=!1,t.enabled=!disabled,n=t.innerHTML,a.innerHTML=n,t.innerHTML="",t.stretched=!1,t.captionElement=a,t.appendChild(l),t.innerElement=l,t.hasAttribute("data-bb-style")){var b=t.getAttribute("data-bb-style");"stretch"==b&&(outerNormal+=" bb-button-stretch",t.stretched=!0)}return i=t.hasAttribute("data-bb-img")?t.getAttribute("data-bb-img"):void 0,i&&(n&&0!=n.length?(a.setAttribute("class","bb-button-caption-with-image"),o=document.createElement("div"),t.imgElement=o,bb.device.newerThan10dot1?o.setAttribute("class","bb-button-image bb-button-image-10dot2"):o.setAttribute("class","bb-button-image"),o.style["background-image"]='url("'+i+'")',l.appendChild(o)):(bb.device.newerThan10dot1?(outerNormal+=" bb-button-container-image-only bb-button-caption-with-image-only_10dot2",a.setAttribute("class","bb-button-caption-with-image-only bb-button-caption-with-image-only_10dot2")):(outerNormal+=" bb-button-container-image-only",a.setAttribute("class","bb-button-caption-with-image-only")),a.style["background-image"]='url("'+i+'")',t.style["line-height"]="0px",t.isImageOnly=!0)),l.appendChild(a),e=normal+" bb-button-disabled-"+bb.screen.controlColor,bb.device.newerThan10dot2&&(e+=" bb-button-disabled-"+bb.screen.controlColor+"-10dot3"),normal=normal+" bb-button-"+bb.screen.controlColor,disabled?(t.removeAttribute("data-bb-disabled"),l.setAttribute("class",e)):l.setAttribute("class",normal),t.setAttribute("class",outerNormal),t.outerNormal=outerNormal,t.outerNormalWithoutImageOnly=r,t.innerElement=l,l.normal=normal,l.highlight=s,l.disabledStyle=e,disabled||(t.ontouchstart=function(){this.innerElement.setAttribute("class",this.innerElement.highlight)},t.ontouchend=function(){this.innerElement.setAttribute("class",this.innerElement.normal)}),t.trappedClick=t.onclick,t.onclick=void 0,null!==t.trappedClick&&t.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1),t.setCaption=function(t){if(this.isImageOnly&&t.length>0){this.captionElement.setAttribute("class","bb-button-caption-with-image");var e=document.createElement("div");this.imgElement=e,e.setAttribute("class","bb-button-image"),e.style["background-image"]=this.captionElement.style["background-image"],this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(e),this.innerElement.appendChild(this.captionElement),this.setAttribute("class",this.outerNormalWithoutImageOnly),this.captionElement.style["background-image"]="",this.isImageOnly=!1}else 0==t.length&&this.imgElement&&(this.captionElement.setAttribute("class","bb-button-caption-with-image-only"),this.setAttribute("class",this.outerNormalWithoutImageOnly+" bb-button-container-image-only"),this.captionElement.style["background-image"]=this.imgElement.style["background-image"],this.isImageOnly=!0,this.innerElement.removeChild(this.imgElement),this.imgElement=null);this.captionElement.innerHTML=t},t.getCaption=function(){return this.captionElement.innerHTML},t.getCaption=t.getCaption.bind(t),t.setImage=function(t){if(this.isImageOnly)this.captionElement.style["background-image"]='url("'+t+'")';else if(this.imgElement&&t.length>0)this.imgElement.style["background-image"]='url("'+t+'")';else if(t.length>0){this.captionElement.setAttribute("class","bb-button-caption-with-image");var e=document.createElement("div");this.imgElement=e,bb.device.newerThan10dot1?e.setAttribute("class","bb-button-image bb-button-image-10dot2"):e.setAttribute("class","bb-button-image"),e.style["background-image"]='url("'+t+'")',this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(e),this.innerElement.appendChild(this.captionElement)}else this.imgElement&&0==t.length&&(this.innerElement.removeChild(this.imgElement),this.imgElement=null,this.captionElement.setAttribute("class",""))},t.getImage=function(){return this.isImageOnly?this.captionElement.style["background-image"].slice(4,-1):this.imgElement?this.imgElement.style["background-image"].slice(4,-1):""},t.getImage=t.getImage.bind(t),t.enable=function(){this.enabled||(this.innerElement.setAttribute("class",this.innerElement.normal),this.ontouchstart=function(){this.innerElement.setAttribute("class",this.innerElement.highlight)},this.ontouchend=function(){this.innerElement.setAttribute("class",this.innerElement.normal)},this.enabled=!0)},t.enable=t.enable.bind(t),t.disable=function(){this.enabled&&(this.innerElement.setAttribute("class",this.innerElement.disabledStyle),this.ontouchstart=null,this.ontouchend=null,this.enabled=!1)},t.disable=t.disable.bind(t),t.show=function(){this.style.display=this.stretched?"block":"inline-block",bb.refresh()
},t.show=t.show.bind(t),t.hide=function(){this.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.parentNode.removeChild(this),bb.refresh()},t.remove=t.remove.bind(t),t}},_bb10_checkbox={apply:function(t){for(var e=0;t.length>e;e++)bb.checkbox.style(t[e])},style:function(t){var e,i,n,o,r=bb.screen.controlColor;return e=document.createElement("div"),e.setAttribute("class","bb-checkbox-target"),t.parentNode&&t.parentNode.insertBefore(e,t),t.style.display="none",e.appendChild(t),e.input=t,t.touchTarget=e,i=document.createElement("div"),bb.device.newerThan10dot2?i.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-10dot3 bb-checkbox-outer-"+r):i.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-"+r),e.appendChild(i),n=document.createElement("div"),n.normal="bb-checkbox-inner bb-checkbox-inner-"+r,bb.device.newerThan10dot2&&(n.normal+=" bb-checkbox-inner-10dot3"),n.setAttribute("class",n.normal),i.appendChild(n),o=document.createElement("div"),o.hiddenClass="bb-checkbox-check-hidden bb-checkbox-check-image",o.displayClass="bb-checkbox-check-display bb-checkbox-check-image",bb.device.newerThan10dot2&&(o.hiddenClass+=" bb-checkbox-check-hidden-10dot3 bb-checkbox-check-image-10dot3",o.displayClass+=" bb-checkbox-check-display-10dot3 bb-checkbox-check-image-10dot3"),o.setAttribute("class",o.hiddenClass),o.style["-webkit-transition-property"]=bb.device.newerThan10dot2?"opacity":"all",o.style["-webkit-transition-duration"]="0.1s",n.appendChild(o),e.checkElement=o,e.innerElement=n,bb.device.newerThan10dot2?(e.highlight="-webkit-linear-gradient(top, "+bb.options.highlightColor+", "+bb.options.highlightColor+")",e.touchHighlight="-webkit-linear-gradient(top, #C6C6C6 ,#C6C6C6)"):(e.highlight="-webkit-linear-gradient(top, rgb("+(bb.options.shades.R+32)+", "+(bb.options.shades.G+32)+", "+(bb.options.shades.B+32)+") 0%, rgb("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+") 100%)",e.touchHighlight="-webkit-linear-gradient(top, rgba("+(bb.options.shades.R-64)+", "+(bb.options.shades.G-64)+", "+(bb.options.shades.B-64)+",0.25) 0%, rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+",0.25) 100%)"),e.ontouchstart=function(){this.input.checked||this.input.disabled||(this.innerElement.style.background=this.touchHighlight)},e.ontouchend=function(){this.input.checked||this.input.disabled||(this.innerElement.style.background="")},e.onclick=function(){if(!this.input.disabled){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.input.checked=!this.input.checked,this.drawChecked(),this.input.dispatchEvent(t)}},e.drawChecked=function(){this.input.checked?(this.checkElement.setAttribute("class",this.checkElement.displayClass),this.innerElement.style["background-image"]=e.highlight):(this.checkElement.setAttribute("class",this.checkElement.hiddenClass),this.innerElement.style["background-image"]=""),this.input.disabled?bb.device.newerThan10dot2?(this.innerElement.parentNode.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-10dot3 bb-checkbox-outer-disabled-10dot3-"+r),this.innerElement.setAttribute("class","bb-checkbox-inner bb-checkbox-inner-10dot3 bb-checkbox-inner-disabled-10dot3-"+r),this.innerElement.style["background-image"]=""):(this.innerElement.parentNode.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-disabled-"+r),this.innerElement.setAttribute("class","bb-checkbox-inner bb-checkbox-inner-disabled-"+r),this.innerElement.style.background="#c0c0c0"):bb.device.newerThan10dot2?(this.innerElement.parentNode.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-10dot3 bb-checkbox-outer-"+r),this.innerElement.setAttribute("class","bb-checkbox-inner bb-checkbox-inner-10dot3 bb-checkbox-inner-10dot3-"+r),this.input.checked&&(this.innerElement.style["background-image"]=e.highlight)):(this.innerElement.parentNode.setAttribute("class","bb-checkbox-outer bb-checkbox-outer-"+r),this.innerElement.setAttribute("class","bb-checkbox-inner bb-checkbox-inner-"+r))},e.drawChecked=e.drawChecked.bind(e),t.setChecked=function(t){t!=this.checked&&(this.checked=t,this.touchTarget.drawChecked())},t.setChecked=t.setChecked.bind(t),t.getChecked=function(){return this.checked},t.getChecked=t.getChecked.bind(t),t.enable=function(){this.removeAttribute("disabled"),this.enabled=!0,this.touchTarget.drawChecked()},t.enable=t.enable.bind(t),t.disable=function(){this.enabled=!1,this.setAttribute("disabled","disabled"),this.touchTarget.drawChecked()},t.disable=t.disable.bind(t),t.show=function(){this.touchTarget.style.display="block",bb.refresh()},t.show=t.show.bind(t),t.hide=function(){this.touchTarget.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.touchTarget.parentNode.removeChild(this.touchTarget),bb.refresh()},t.remove=t.remove.bind(t),e.drawChecked(),e}},_bb10_contextMenu={actionIds:[],create:function(){var t=document.createElement("div");return t.style.display="none",t.actions=[],t.oncontextmenu=function(t){this.centerMenuItems();for(var e,i=t.srcElement,n=!1,o="";i;){if(i.hasAttribute&&(o=i.hasAttribute("data-bb-type")?i.getAttribute("data-bb-type").toLowerCase():void 0,"item"==o)){n=i.hasAttribute("data-webworks-context");break}i=i.parentNode}n?(i.drawSelected(),e=i.getAttribute("data-webworks-context"),e=JSON.parse(e),this.selected={title:e.header,description:e.subheader,selected:i}):t.preventDefault(),blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar)},t.oncontextmenu=t.oncontextmenu.bind(t),window.addEventListener("contextmenu",t.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:t.oncontextmenu}),t.oncontextmenuclosed=function(){this.selected&&this.selected.selected&&this.selected.selected.drawUnselected(),blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)},t.oncontextmenuclosed=t.oncontextmenuclosed.bind(t),document.addEventListener("bbui.contextClosed",t.oncontextmenuclosed),bb.documentListeners.push({name:"bbui.contextClosed",eventHandler:t.oncontextmenuclosed}),t.add=function(t){this.actions.push(t),this.appendChild(t);var e={actionId:bb.guidGenerator(),label:t.innerHTML,icon:t.getAttribute("data-bb-img")};bb.contextMenu.actionIds.push(e.actionId),t.pinned=!1,t.menuItem=e,t.menu=this,t.visible=t.hasAttribute("data-bb-visible")?"false"!=t.getAttribute("data-bb-visible").toLowerCase():!0,t.hasAttribute("data-bb-pin")&&"true"==t.getAttribute("data-bb-pin").toLowerCase()&&(t.pinned=!0),t.doclick=function(e){var i,n=document.querySelectorAll("[data-bb-context-menu-id="+e+"]");if(n.length>0){n=n[0],i=n.getAttribute("data-webworks-context"),i=JSON.parse(i),this.menu.selected={title:i.header,description:i.subheader,selected:n};var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t.dispatchEvent(o)}},t.doclick=t.doclick.bind(t),t.show=function(){this.visible||(this.visible=!0,this.removeAttribute("data-bb-visible"))},t.show=t.show.bind(t),t.hide=function(){this.visible&&(this.visible=!1,this.setAttribute("data-bb-visible","false"))},t.hide=t.hide.bind(t)},t.add=t.add.bind(t),t.centerMenuItems=function(){var t,e,i=[blackberry.ui.contextmenu.CONTEXT_ALL],n={includeContextItems:[blackberry.ui.contextmenu.CONTEXT_ALL],includePlatformItems:!1,includeMenuServiceItems:!1};for(t=0;this.actions.length>t;t++)e=this.actions[t],e.visible&&e.pinned&&(n.pinnedItemId=e.menuItem.actionId);for(this.clearWWcontextMenu(),blackberry.ui.contextmenu.defineCustomContext("bbui-context",n),t=this.actions.length-1;t>=0;t--)e=this.actions[t],e.visible&&blackberry.ui.contextmenu.addItem(i,e.menuItem,e.doclick)},t.centerMenuItems=t.centerMenuItems.bind(t),t.clearWWcontextMenu=function(){var t,e=[blackberry.ui.contextmenu.CONTEXT_ALL];for(t=0;bb.contextMenu.actionIds.length>t;t++)blackberry.ui.contextmenu.removeItem(e,bb.contextMenu.actionIds[t])},t.centerMenuItems=t.centerMenuItems.bind(t),t.show=function(){},t.show=t.show.bind(t),t.peek=function(){},t.peek=t.peek.bind(t),t}},_bb10_dropdown={apply:function(t){for(i=0;t.length>i;i++)bb.dropdown.style(t[i])},style:function(t){var e,i,n,o,r,s,a,l,b,d,c=!t.hasAttribute("disabled"),h="bb-dropdown bb-dropdown-"+bb.screen.controlColor,u="bb-dropdown bb-dropdown-highlight-"+bb.screen.controlColor,p="bb-dropdown-container bb-dropdown-container-"+bb.screen.controlColor,m="bb-dropdown-container-inner bb-dropdown-container-inner-"+bb.screen.controlColor,g="bb-dropdown-inner bb-dropdown-inner-"+bb.screen.controlColor;if(bb.device.newerThan10dot2===!0?(h="bb-dropdown bb-dropdown-10dot3 bb-dropdown-"+bb.screen.controlColor,u="bb-dropdown bb-dropdown-10dot3 bb-dropdown-highlight-10dot3-"+bb.screen.controlColor,p+=" bb-dropdown-container-10dot3",m+=" bb-dropdown-container-inner-10dot3",g+=" bb-dropdown-inner-10dot3",d=u+" bb10Highlight",u+=" bb-dropdown-"+bb.screen.controlColor+"-highlight-10dot3"):bb.device.newerThan10dot1?(p+=" bb-dropdown-container-10dot2",m+=" bb-dropdown-container-inner-10dot2",g+=" bb-dropdown-inner-10dot2",d=u+" bb10Highlight",u+=" bb-dropdown-"+bb.screen.controlColor+"-highlight-10dot2"):u+=" bb10Highlight",t.style.display="none",t.enabled=c,s=document.createElement("div"),s.select=t,s.items=[],s.setAttribute("data-bb-type","dropdown"),t.dropdown=s,t.parentNode&&t.parentNode.insertBefore(s,t),s.appendChild(t),o=document.createElement("div"),o.setAttribute("class",m),s.appendChild(o),t.hasAttribute("data-bb-style")){var v=t.getAttribute("data-bb-style");"stretch"==v&&(h+=" bb-dropdown-stretch",u+=" bb-dropdown-stretch")}r=document.createElement("div"),t.enabled?r.setAttribute("class",h):r.setAttribute("class",h+" bb-dropdown-disabled-"+bb.screen.controlColor),o.appendChild(r),n=document.createElement("div"),n.setAttribute("class",g),r.appendChild(n),a=document.createElement("div"),s.labelElement=a,a.setAttribute("class","bb-dropdown-label"),t.hasAttribute("data-bb-label")&&(a.innerHTML=t.getAttribute("data-bb-label")),n.appendChild(a),e=document.createElement("div"),bb.device.newerThan10dot2===!0?(e.normal="bb-dropdown-arrow-"+bb.screen.controlColor+" bb-dropdown-arrow-10dot3",e.highlight="bb-dropdown-arrow-dark bb-dropdown-arrow-10dot3"):bb.device.newerThan10dot1?(e.normal="bb-dropdown-arrow-"+bb.screen.controlColor+" bb-dropdown-arrow-10dot2",e.highlight="bb-dropdown-arrow-dark bb-dropdown-arrow-10dot2"):e.normal="bb-dropdown-arrow-"+bb.screen.controlColor,e.setAttribute("class",e.normal),n.appendChild(e),s.img=e,l=document.createElement("div"),s.captionElement=l,bb.device.newerThan10dot2===!0?l.setAttribute("class","bb-dropdown-caption bb-dropdown-caption-10dot3"):bb.device.newerThan10dot1?l.setAttribute("class","bb-dropdown-caption bb-dropdown-caption-10dot2"):l.setAttribute("class","bb-dropdown-caption"),n.appendChild(l);var f=document.createElement("div");f.style.position="relative",f.style["margin-top"]=bb.device.newerThan10dot2===!0?"3px":"10px",f.style.overflow="hidden",o.appendChild(f);var y=document.createElement("div");return f.appendChild(y),b=document.createElement("div"),s.itemsElement=b,b.setAttribute("class","bb-dropdown-items"),y.appendChild(b),s.refreshOptions=function(){var n,o,r,s,a,b,d=t.getElementsByTagName("option"),c="";for(this.itemsElement.innerHTML="",this.items=[],this.options=d,i=0;d.length>i;i++)n=d[i],o=document.createElement("div"),this.items.push(o),o.selectedStyle="bb-dropdown-item bb-dropdown-item-"+bb.screen.controlColor+" bb-dropdown-item-selected-"+bb.screen.controlColor,o.normalStyle="bb-dropdown-item bb-dropdown-item-"+bb.screen.controlColor,o.index=i,o.select=this.select,o.dropdown=this,o.dropdown.selected||(o.dropdown.selected=o),a=document.createElement("div"),a.setAttribute("class","primary-text"),a.innerHTML=n.innerHTML,r=document.createElement("div"),r.setAttribute("class","text-container"),r.appendChild(a),s=document.createElement("span"),s.setAttribute("class","text-align"),o.appendChild(s),o.appendChild(r),this.itemsElement.appendChild(o),n.hasAttribute("data-bb-accent-text")&&(b=document.createElement("div"),b.setAttribute("class","accent-text"),b.innerHTML=n.getAttribute("data-bb-accent-text"),o.accentText=b,r.appendChild(b)),e=document.createElement("div"),e.setAttribute("class","bb-dropdown-selected-image-"+bb.screen.controlColor),o.img=e,o.appendChild(e),n.hasAttribute("selected")||n.selected?(c=n.innerHTML,o.setAttribute("class",o.selectedStyle),e.style.visibility="visible",o.dropdown.selected=o):o.setAttribute("class",o.normalStyle),o.ontouchstart=function(){this.style["background-color"]=bb.options.highlightColor,this.style.color="white",this.accentText&&(this.accentText.style.color="white")},o.ontouchend=function(){this.style["background-color"]="",this.style.color="",this.accentText&&(this.accentText.style.color="")},o.onclick=function(){this.select.setSelectedItem(this.index)};""==c&&d.length>0&&(c=d[0].innerHTML),""!=c&&(l.innerHTML=c)},s.refreshOptions=s.refreshOptions.bind(s),s.refreshOptions(),s.setAttribute("class",p),s.buttonOuter=r,s.isRefreshed=!1,s.caption=l,r.dropdown=s,s.open=!1,r.normal=h,r.highlight=u,r.focusedHighlight=d,s.scroller=new iScroll(f,{vScrollbar:!1,onBeforeScrollStart:function(t){bb.scroller&&bb.scroller.disable(),t.preventDefault()},onBeforeScrollEnd:function(){bb.scroller&&bb.scroller.enable()}}),bb.dropdownScrollers.push(s.scroller),s.scrollArea=f,r.dotouchstart=function(){this.setAttribute("class",this.highlight)},r.dotouchend=function(){this.setAttribute("class",this.normal)},r.doclick=function(){this.dropdown.open?this.dropdown.internalHide():this.dropdown.internalShow()},t.enabled&&(r.ontouchstart=r.dotouchstart,r.ontouchend=r.dotouchend,r.onclick=r.doclick),s.internalShow=function(){var t;this.open=!0,this.numItems=bb.device.is720x720&&this.options.length>4?3:this.options.length>5?5:this.options.length,bb.device.is1024x600?(t=43*this.numItems,this.style.height=45+t+"px"):bb.device.is1280x768?bb.device.newerThan10dot2===!0?(t=99*this.numItems,this.style.height=80+t+"px"):(t=99*this.numItems,this.style.height=95+t+"px"):bb.device.is1280x720?bb.device.newerThan10dot2===!0?(t=80*this.numItems,this.style.height=65+t+"px"):(t=99*this.numItems,this.style.height=95+t+"px"):bb.device.is1440x1440?(t=120*this.numItems,this.style.height=96+t+"px"):bb.device.is720x720?(t=85*this.numItems,this.style.height=77+t+"px"):(t=99*this.numItems,this.style.height=95+t+"px"),this.scrollArea.style.height=bb.device.newerThan10dot2===!0?t-3+"px":t-10+"px",this.isRefreshed||(this.scroller.refresh(),this.isRefreshed=!0),this.scroller.scrollToElement(this.selected,0),this.caption.style.opacity="0.0",this.caption.style["-webkit-transition"]="opacity 0.5s linear",this.caption.style["-webkit-backface-visibility"]="hidden",this.caption.style["-webkit-perspective"]=1e3,this.caption.style["-webkit-transform"]="translate3d(0,0,0)",this.img.style.opacity="1.0",bb.device.newerThan10dot1?(this.img.setAttribute("class",this.img.highlight),this.img.style["-webkit-transition"]="all 0.2s linear",this.img.style["-webkit-transform"]="rotate(-360deg)",this.buttonOuter.setAttribute("class",this.buttonOuter.focusedHighlight),this.buttonOuter.style.color="white"):(this.img.style["-webkit-transform"]="rotate(-360deg)",this.img.style["-webkit-transition"]="all 0.5s ease-in-out"),bb.scroller&&bb.scroller.refresh(),this.scrollIntoView(!1)},s.internalShow=s.internalShow.bind(s),s.internalHide=function(){this.open=!1,this.style.height="59px",this.style.height=bb.device.is1024x600?"43px":bb.device.is1280x768?bb.device.newerThan10dot2===!0?"83px":bb.device.newerThan10dot1?"88px":"95px":bb.device.is720x720?bb.device.newerThan10dot1?"70px":"77px":bb.device.is1280x720&&bb.device.newerThan10dot1&&1.9>window.devicePixelRatio?bb.device.newerThan10dot2===!0?"64px":"76px":bb.device.is1440x1440?"96px":"95px",this.caption.style.opacity="1.0",this.caption.style["-webkit-transition"]="opacity 0.5s linear",this.caption.style["-webkit-backface-visibility"]="hidden",this.caption.style["-webkit-perspective"]=1e3,bb.device.newerThan10dot1?(this.img.setAttribute("class",this.img.normal),this.img.style["-webkit-transform"]="rotate(-180deg)",this.img.style["-webkit-transition"]="all 0.2s linear",this.buttonOuter.setAttribute("class",this.buttonOuter.normal),this.buttonOuter.style.color=""):(this.img.style.opacity="0.0",this.img.style["-webkit-transform"]="rotate(0deg)",this.img.style["-webkit-transition"]="all 0.5s ease-in-out"),bb.scroller&&bb.scroller.refresh()},s.internalHide=s.internalHide.bind(s),t.setSelectedItem=function(t){if(this.selectedIndex!=t){var e=this.dropdown.items[t];if(!e)return;this.dropdown.selected&&(this.dropdown.selected.setAttribute("class",e.normalStyle),this.dropdown.selected.img.style.visibility="hidden"),e.setAttribute("class",e.selectedStyle),e.img.style.visibility="visible",this.dropdown.selected=e,this.selectedIndex=t,this.dropdown.caption.innerHTML=this.options[t].text,this.dropdown.internalHide(),window.setTimeout(this.fireEvent,0)}},t.setSelectedItem=t.setSelectedItem.bind(t),t.setSelectedText=function(t){for(var e=0;this.options.length>e;e++)if(this.options[e].text==t)return this.setSelectedItem(e),void 0},t.setSelectedText=t.setSelectedText.bind(t),t.fireEvent=function(){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dispatchEvent(t)},t.fireEvent=t.fireEvent.bind(t),t.enable=function(){this.enabled||(this.dropdown.buttonOuter.ontouchstart=this.dropdown.buttonOuter.dotouchstart,this.dropdown.buttonOuter.ontouchend=this.dropdown.buttonOuter.dotouchend,this.dropdown.buttonOuter.onclick=this.dropdown.buttonOuter.doclick,this.dropdown.buttonOuter.setAttribute("class",this.dropdown.buttonOuter.normal),this.removeAttribute("disabled"),this.enabled=!0)},t.enable=t.enable.bind(t),t.disable=function(){this.enabled&&(this.dropdown.internalHide(),this.dropdown.buttonOuter.ontouchstart=null,this.dropdown.buttonOuter.ontouchend=null,this.dropdown.buttonOuter.onclick=null,this.dropdown.buttonOuter.setAttribute("class",this.dropdown.buttonOuter.normal+" bb-dropdown-disabled-"+bb.screen.controlColor),this.enabled=!1,this.setAttribute("disabled","disabled"))},t.disable=t.disable.bind(t),t.show=function(){this.dropdown.style.display="block",bb.refresh()},t.show=t.show.bind(t),t.hide=function(){this.dropdown.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.dropdown.parentNode.removeChild(this.dropdown),bb.refresh()},t.remove=t.remove.bind(t),t.refresh=function(){this.dropdown.internalHide(),this.dropdown.isRefreshed=!1,this.dropdown.refreshOptions()},t.refresh=t.refresh.bind(t),t.setCaption=function(t){this.dropdown.labelElement.innerHTML=t,this.setAttribute("data-bb-label",t)},t.setCaption=t.setCaption.bind(t),t.getCaption=function(){return this.dropdown.labelElement.innerHTML},t.getCaption=t.getCaption.bind(t),s}},_bb10_fileInput={apply:function(t){var e,i,n;for(e=0;t.length>e;e++)i=t[e],i.setAttribute("class","bb-file-button"),n=document.createElement("div"),n.setAttribute("data-bb-type","button"),n.innerHTML=i.hasAttribute("data-bb-caption")?i.getAttribute("data-bb-caption"):"Choose File",n.origCaption=n.innerHTML,bb.button.apply([n]),n.input=i,i.parentNode.insertBefore(n,i),n.appendChild(i),n.handleChange=function(){this.input.value?this.setCaption(this.input.value.replace(/^.*[\\\/]/,"")):this.setCaption(this.origCaption)},n.handleChange=n.handleChange.bind(n),i.addEventListener("change",n.handleChange,!1)}},_bb10_grid={apply:function(t){for(var e,i=!1,n=0;t.length>n;n++){var o,r,s,a,l,b,d=t[n];for(d.setAttribute("class","bb-grid"),d.isSquare=d.hasAttribute("data-bb-style")&&"square"==d.getAttribute("data-bb-style").toLowerCase(),i=d.hasAttribute("data-bb-header-style")?"solid"==d.getAttribute("data-bb-header-style").toLowerCase():!1,e=d.hasAttribute("data-bb-header-justify")?d.getAttribute("data-bb-header-justify").toLowerCase():"center",d.hasAttribute("data-bb-context")&&"true"==d.getAttribute("data-bb-context").toLowerCase()&&(b=bb.screen.contextMenu),r=d.querySelectorAll("[data-bb-type=group], [data-bb-type=row]"),o=0;r.length>o;o++)if(l=r[o],l.hasAttribute("data-bb-type"))if(s=l.getAttribute("data-bb-type").toLowerCase(),"group"==s&&l.hasAttribute("data-bb-title"))a=document.createElement("div"),a.normal="bb-grid-header",a.innerHTML="<p>"+l.getAttribute("data-bb-title")+"</p>",i?(a.normal=a.normal+" bb10Accent",a.style.color="white",a.style["border-bottom-color"]="transparent",bb.device.newerThan10dot2&&(a.normal=a.normal+" bb-grid-header-10dot3 bb-grid-header-normal-"+bb.screen.listColor+"-10dot3")):(a.normal=a.normal+" bb-grid-header-normal-"+bb.screen.listColor,bb.device.newerThan10dot2?a.normal=a.normal+" bb-grid-header-10dot3 bb-grid-header-normal-"+bb.screen.listColor+"-10dot3":a.style["border-bottom-color"]=bb.options.shades.darkOutline),a.normal="left"==e?a.normal+" bb-grid-header-left":"right"==e?a.normal+" bb-grid-header-right":a.normal+" bb-grid-header-center",a.setAttribute("class",a.normal),l.firstChild?l.insertBefore(a,l.firstChild):l.appendChild(a);else if("row"==s){var c,h,u,p,m,g,v,f,y,v,w,E,x,C,k=0,B=-1,A=l.querySelectorAll("[data-bb-type=item]");if(m=A.length,0==m)continue;for(l.hasAttribute("data-bb-columns")&&(B=l.getAttribute("data-bb-columns")),h=document.createElement("table"),h.style.width="100%",l.appendChild(h),u=document.createElement("tr"),h.appendChild(u),B>0?A.length>B&&!bb.device.isPlayBook?(l.style["overflow-y"]="hidden",l.style["overflow-x"]="scroll",E=window.innerWidth/(parseInt(B)+.5)):E=window.innerWidth/B-6:E=window.innerWidth/m-6,c=0;m>c;c++)g=A[c],bb.device.isPlayBook&&B>0&&c>B-1?g.style.display="none":(v=g.innerHTML,a=g.getAttribute("data-bb-title"),x=v||a,g.innerHTML="",p=document.createElement("td"),u.appendChild(p),p.appendChild(g),k++,w=d.isSquare?E:Math.ceil(.5625*E),g.style.width=E+"px",g.style.height=w+"px",f=document.createElement("img"),f.style.height=w+"px",f.style.width=E+"px",f.style.opacity="0",f.style["-webkit-transition"]="opacity 0.5s linear",f.style["-webkit-transform"]="translate3d(0,0,0)",f.itemNode=g,g.image=f,g.appendChild(f),g.onbbuidomready=function(){bb.isScrolledIntoView(this)?(this.image.onload=function(){this.style.opacity="1.0"},this.image.src=this.getAttribute("data-bb-img")):(document.addEventListener("bbuiscrolling",this.onbbuiscrolling,!1),this.listener={name:"bbuiscrolling",eventHandler:this.onbbuiscrolling},bb.documentListeners.push(this.listener)),document.removeEventListener("bbuidomready",this.onbbuidomready,!1)},g.onbbuidomready=g.onbbuidomready.bind(g),document.addEventListener("bbuidomready",g.onbbuidomready,!1),g.onbbuiscrolling=function(){if(bb.isScrolledIntoView(this)){this.image.onload=function(){this.style.opacity="1.0"},this.image.src=this.getAttribute("data-bb-img"),document.removeEventListener("bbuiscrolling",this.onbbuiscrolling,!1);var t=bb.documentListeners.indexOf(this.listener);t>=0&&bb.documentListeners.splice(t,1)}},g.onbbuiscrolling=g.onbbuiscrolling.bind(g),x?(y=document.createElement("div"),a&&v?(y.setAttribute("class","bb-grid-item-overlay bb-grid-item-overlay-two-rows"),y.innerHTML='<div><p class="title title-two-rows">'+a+"<br/>"+v+"</p></div>"):a?(y.setAttribute("class","bb-grid-item-overlay bb-grid-item-overlay-one-row"),y.innerHTML='<div><p class="title title-one-row">'+a+"</p></div>"):v&&(y.setAttribute("class","bb-grid-item-overlay bb-grid-item-overlay-one-row"),y.innerHTML='<div><p class="title title-one-row">'+v+"</p></div>"),g.appendChild(y)):y=null,g.overlay=y,g.title=a,g.description=v,g.fingerDown=!1,g.contextShown=!1,g.contextMenu=b,g.contextMenu&&(g.guid="bbui"+bb.guidGenerator(),g.setAttribute("data-bb-context-menu-id",g.guid),C=Object(),C.id=g.guid,C.type="bbui-context",C.header=g.title,C.subheader=g.description,g.setAttribute("data-webworks-context",JSON.stringify(C))),g.ontouchstart=function(){if(this.overlay&&(this.overlay.style.opacity="1.0",this.overlay.style["background-color"]=bb.options.highlightColor),g.fingerDown=!0,g.contextShown=!1,g.contextMenu&&(bb.device.isPlayBook||bb.device.isRipple)){window.setTimeout(this.touchTimer,667);var t=bb.getCurScreen();g.touchstartx=t.bbUIscrollWrapper.scrollTop}},g.ontouchend=function(){this.overlay&&(this.overlay.style.opacity="",this.overlay.style["background-color"]=""),g.fingerDown=!1,g.contextShown&&(event.preventDefault(),event.stopPropagation())},g.touchTimer=function(){if(bb.device.isPlayBook||bb.device.isRipple){var t=bb.getCurScreen(),e=t.bbUIscrollWrapper.scrollTop;g.fingerDown&&50>Math.abs(g.touchstartx-e)&&(g.contextShown=!0,g.contextMenu.peek({title:this.title,description:this.description,selected:this}))}},g.touchTimer=g.touchTimer.bind(g),g.drawSelected=function(){this.overlay&&(this.overlay.style.opacity="1.0",this.overlay.style["background-color"]=bb.options.highlightColor)},g.drawSelected=g.drawSelected.bind(g),g.drawUnselected=function(){this.overlay&&(this.overlay.style.opacity="",this.overlay.style["background-color"]="")},g.drawUnselected=g.drawUnselected.bind(g));if(B>0&&B>k){var T=B-k;for(l.extraColumns=[],c=0;T>c;c++)p=document.createElement("td"),u.appendChild(p),p.style.width=E+"px",l.extraColumns.push(p)}}d.orientationChanged=function(){var t,e,i,n,o,r,s,a,l=this.querySelectorAll("[data-bb-type=row]");for(t=0;l.length>t;t++){var b=-1;for(n=l[t],i=n.querySelectorAll("[data-bb-type=item]"),o=i.length,n.hasAttribute("data-bb-columns")&&(b=n.getAttribute("data-bb-columns")),s=b>0?i.length>b&&!bb.device.isPlayBook?window.innerWidth/(parseInt(b)+.5):window.innerWidth/b-6:window.innerWidth/o-6,e=0;o>e;e++)r=i[e],a=d.isSquare?s:Math.ceil(.5625*s),r.image.style.height=a+"px",r.image.style.width=s+"px",r.image.style["-webkit-transition-property"]="all",r.image.style["-webkit-transition-duration"]="0.2s",r.image.style["-webkit-transition-timing-function"]="linear",r.image.style["-webkit-transform"]="translate3d(0,0,0)",r.style.width=s+"px",r.style.height=a+"px",r.style["-webkit-transition-property"]="all",r.style["-webkit-transition-duration"]="0.2s",r.style["-webkit-transition-timing-function"]="linear",r.style["-webkit-transform"]="translate3d(0,0,0)";if(n.extraColumns)for(e=0;n.extraColumns.length>e;e++)n.extraColumns[e].style.width=s+"px"}},d.orientationChanged=d.orientationChanged.bind(d),window.addEventListener("resize",d.orientationChanged,!1),bb.windowListeners.push({name:"resize",eventHandler:d.orientationChanged}),d.show=function(){this.style.display="block",bb.refresh()},d.show=d.show.bind(d),d.hide=function(){this.style.display="none",bb.refresh()},d.hide=d.hide.bind(d),d.remove=function(){this.parentNode.removeChild(this),bb.refresh()},d.remove=d.remove.bind(d)}}},_bb10_imageList={apply:function(elements){var i,j,outerElement,items;for(i=0;elements.length>i;i++){outerElement=elements[i],outerElement.items=[],outerElement.setAttribute("class","bb-image-list"),outerElement.hideImages=outerElement.hasAttribute("data-bb-images")?"none"==outerElement.getAttribute("data-bb-images").toLowerCase():!1,outerElement.hideImages||(outerElement.imagePlaceholder=outerElement.hasAttribute("data-bb-image-placeholder")?outerElement.getAttribute("data-bb-image-placeholder"):void 0,outerElement.imageLoading=outerElement.hasAttribute("data-bb-image-loading")?outerElement.getAttribute("data-bb-image-loading"):void 0),outerElement.listStyle=outerElement.hasAttribute("data-bb-style")?outerElement.getAttribute("data-bb-style").toLowerCase():"default",outerElement.solidHeader=outerElement.hasAttribute("data-bb-header-style")?"solid"==outerElement.getAttribute("data-bb-header-style").toLowerCase():!1,outerElement.headerJustify=outerElement.hasAttribute("data-bb-header-justify")?outerElement.getAttribute("data-bb-header-justify").toLowerCase():"center",outerElement.hasAttribute("data-bb-context")&&"true"==outerElement.getAttribute("data-bb-context").toLowerCase()&&(outerElement.contextMenu=bb.screen.contextMenu),outerElement.styleItem=function(innerChildNode){if(innerChildNode.hasAttribute("data-bb-type")){var type=innerChildNode.getAttribute("data-bb-type").toLowerCase(),description=innerChildNode.innerHTML,title,overlay,accentText,img,details,detailsClass,descriptionDiv,btn,btnBorder,highlight,normal,btnInner,json;innerChildNode.btn=void 0,"header"==type?(normal="bb-image-list-header",this.solidHeader?(normal+=" bb10Accent",innerChildNode.style.color="white",innerChildNode.style["border-bottom-color"]="transparent"):(normal=normal+" bb-image-list-header-normal-"+bb.screen.listColor,bb.device.newerThan10dot2?normal=normal+" bb-image-list-header-10dot3 bb-image-list-header-normal-"+bb.screen.listColor+"-10dot3":innerChildNode.style["border-bottom-color"]=bb.options.shades.darkOutline),normal+="left"==this.headerJustify?" bb-image-list-header-left":"right"==this.headerJustify?" bb-image-list-header-right":" bb-image-list-header-center",innerChildNode.normal=normal,innerChildNode.innerHTML="<p>"+description+"</p>",innerChildNode.setAttribute("class",normal)):"item"==type&&(normal="bb-image-list-item bb-image-list-item-"+bb.screen.listColor,highlight=normal+" bb-image-list-item-hover bb10Highlight",innerChildNode.normal=normal,innerChildNode.highlight=highlight,innerChildNode.setAttribute("class",normal),innerChildNode.innerHTML="",img=void 0,details=document.createElement("div"),details.innerChildNode=innerChildNode,innerChildNode.details=details,innerChildNode.appendChild(details),detailsClass="bb-image-list-item-details",this.hideImages?detailsClass+=" bb-image-list-item-noimage":(img=new Image,innerChildNode.img=img,this.imagePlaceholder?(img.placeholder=this.imagePlaceholder,img.path=innerChildNode.hasAttribute("data-bb-img")?innerChildNode.getAttribute("data-bb-img"):this.imagePlaceholder):img.path=innerChildNode.getAttribute("data-bb-img"),innerChildNode.onimageload=function(){this.details.style["background-image"]='url("'+this.img.src+'")',innerChildNode.details.style["background-size"]="",this.img=this.img.src},innerChildNode.onimageload=innerChildNode.onimageload.bind(innerChildNode),img.onload=innerChildNode.onimageload,this.imagePlaceholder&&(innerChildNode.onimageerror=function(){this.img.src!=this.img.placeholder&&(this.img.src=this.img.placeholder)},innerChildNode.onimageerror=innerChildNode.onimageerror.bind(innerChildNode),img.onerror=innerChildNode.onimageerror),this.imageLoading&&(innerChildNode.details.style["background-image"]='url("'+this.imageLoading+'")',innerChildNode.details.style["background-size"]=bb.device.is1024x600?"64px 65px":bb.device.is1280x768||bb.device.is1280x720?"109px 110px":bb.device.is720x720?"92px 93px":"109px 110px"),img.src=img.path),title=document.createElement("div"),title.setAttribute("class","title"),title.innerHTML=innerChildNode.getAttribute("data-bb-title"),details.title=title,0==title.innerHTML.length&&(title.innerHTML=" "),details.appendChild(title),descriptionDiv=document.createElement("div"),descriptionDiv.setAttribute("class","description bb-image-list-description-"+bb.screen.listColor),details.description=descriptionDiv,details.appendChild(descriptionDiv),overlay=document.createElement("div"),overlay.setAttribute("class","bb-image-list-item-overlay"),innerChildNode.appendChild(overlay),"arrowlist"==this.listStyle||"arrowbuttons"==this.listStyle||"addbuttons"==this.listStyle||"removebuttons"==this.listStyle?(btn=document.createElement("div"),innerChildNode.appendChild(btn),innerChildNode.btn=btn,btn.outerElement=this,btn.innerChildNode=innerChildNode,innerChildNode.onbtnclick?btn.onbtnclick=innerChildNode.onbtnclick:innerChildNode.hasAttribute("onbtnclick")&&(innerChildNode.onbtnclick=innerChildNode.getAttribute("onbtnclick"),btn.onbtnclick=function(){eval(this.innerChildNode.onbtnclick)}),detailsClass+=" details-button-margin",btn.setAttribute("class","button"),btnBorder=document.createElement("div"),btnBorder.normal="bb-image-list-item-button-border bb-image-list-item-button-"+bb.screen.listColor,btnBorder.setAttribute("class",btnBorder.normal),btn.btnBorder=btnBorder,btn.appendChild(btnBorder),btnInner=document.createElement("div"),btnInner.normal="bb-image-list-item-button-inner",btnInner.highlight=btnInner.normal,btn.btnInner=btnInner,btnBorder.appendChild(btnInner),"arrowlist"!==this.listStyle?("arrowbuttons"==this.listStyle?(btnInner.normal=btnInner.normal+" bb-image-list-item-chevron-"+bb.screen.listColor,btnInner.highlight=btnInner.highlight+" bb-image-list-item-chevron-dark"):"addbuttons"==this.listStyle?(btnInner.normal=btnInner.normal+" bb-image-list-item-add-"+bb.screen.listColor,btnInner.highlight=btnInner.highlight+" bb-image-list-item-add-dark"):"removebuttons"==this.listStyle&&(btnInner.normal=btnInner.normal+" bb-image-list-item-remove-"+bb.screen.listColor,btnInner.highlight=btnInner.highlight+" bb-image-list-item-remove-dark"),btn.ontouchstart=function(){this.onbtnclick&&(this.btnInner.setAttribute("class",this.btnInner.highlight),this.btnBorder.style.background="-webkit-gradient(linear, center top, center bottom, from(rgb("+(bb.options.shades.R+32)+","+(bb.options.shades.G+32)+","+(bb.options.shades.B+32)+")), to("+bb.options.highlightColor+"))")
},btn.ontouchend=function(){this.onbtnclick&&(this.btnBorder.style.background="",this.btnInner.setAttribute("class",this.btnInner.normal))},btn.onclick=function(t){t.stopPropagation(),this.onbtnclick&&(this.outerElement.selected=this.innerChildNode,this.onbtnclick())}):(btnInner.normal=btnInner.normal+" bb-image-list-item-chevron-"+bb.screen.listColor,btnBorder.style.background="transparent",btnBorder.style["border-color"]="transparent"),btnInner.setAttribute("class",btnInner.normal)):innerChildNode.hasAttribute("data-bb-accent-text")&&(accentText=document.createElement("div"),accentText.setAttribute("class","accent-text bb-image-list-accent-text-"+bb.screen.listColor),accentText.innerHTML=innerChildNode.getAttribute("data-bb-accent-text"),details.appendChild(accentText),details.accentText=accentText),0==description.length&&(description=" ",descriptionDiv.style.visibilty="hidden",detailsClass+=" bb-image-list-item-details-nodescription",bb.device.is1024x600?(title.style["margin-top"]="16px",title.style["padding-top"]="28px",overlay.style["margin-top"]="-94px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-59px")):bb.device.is1280x768?(title.style["margin-top"]="-7px",title.style["padding-top"]="20px",overlay.style["margin-top"]="-140px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-102px")):bb.device.is1280x720?(title.style["margin-top"]="-7px",title.style["padding-top"]="20px",overlay.style["margin-top"]="-123px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-102px")):bb.device.is720x720?(title.style["margin-top"]="-14px",title.style["padding-top"]="20px",overlay.style["margin-top"]="-133px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-89px")):bb.device.is1440x1440?(title.style["padding-top"]="28px",overlay.style["margin-top"]="-164px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-126px")):(title.style["margin-top"]="-7px",title.style["padding-top"]="20px",overlay.style["margin-top"]="-121px",innerChildNode.btn&&(innerChildNode.btn.style["margin-top"]="-102px")),accentText&&(accentText.style["margin-top"]=bb.device.is1024x600?"-52px":bb.device.is1280x768||bb.device.is1280x720?"-82px":bb.device.is720x720?"-75px":bb.device.is1440x1440?"-100px":"-82px")),descriptionDiv.innerHTML=description,details.setAttribute("class",detailsClass),innerChildNode.fingerDown=!1,innerChildNode.contextShown=!1,innerChildNode.overlay=overlay,innerChildNode.contextMenu=this.contextMenu,innerChildNode.description=description,innerChildNode.title=title.innerHTML,innerChildNode.ontouchstart=function(){if(bb.device.isPlayBook){if(!innerChildNode.trappedClick&&!this.contextMenu)return;if(innerChildNode.fingerDown=!0,innerChildNode.contextShown=!1,this.overlay.style.visibility="visible",innerChildNode.contextMenu){window.setTimeout(this.touchTimer,667);var t=bb.getCurScreen();innerChildNode.touchstartx=t.bbUIscrollWrapper.scrollTop}}},innerChildNode.ontouchend=function(t){if(bb.device.isPlayBook){if(!innerChildNode.trappedClick&&!this.contextMenu)return;this.overlay.style.visibility="hidden",innerChildNode.fingerDown=!1,innerChildNode.contextShown&&(t.preventDefault(),t.stopPropagation())}},innerChildNode.touchTimer=function(){if(bb.device.isPlayBook){var t=bb.getCurScreen(),e=t.bbUIscrollWrapper.scrollTop;innerChildNode.fingerDown&&50>Math.abs(innerChildNode.touchstartx-e)&&(innerChildNode.contextShown=!0,this.drawSelected(),innerChildNode.contextMenu.hideEvents.push(this.finishHighlight),innerChildNode.contextMenu.peek({title:this.title,description:this.description,selected:this}))}},innerChildNode.touchTimer=innerChildNode.touchTimer.bind(innerChildNode),innerChildNode.drawSelected=function(){this.overlay.style.visibility="visible",bb.device.newerThan10dot2?this.style["background-color"]="light"===bb.screen.listColor?"#E4E4E4":bb.options.shades.darkHighlight:(this.setAttribute("class",this.highlight),this.overlay.style["border-color"]=bb.options.shades.darkOutline)},innerChildNode.drawSelected=innerChildNode.drawSelected.bind(innerChildNode),innerChildNode.drawUnselected=function(){this.overlay.style.visibility="hidden",bb.device.newerThan10dot2?this.style["background-color"]="":(this.setAttribute("class",this.normal),this.overlay.style["border-color"]="transparent")},innerChildNode.drawUnselected=innerChildNode.drawUnselected.bind(innerChildNode),this.contextMenu&&(innerChildNode.guid="bbui"+bb.guidGenerator(),innerChildNode.setAttribute("data-bb-context-menu-id",innerChildNode.guid),json=Object(),json.id=innerChildNode.guid,json.type="bbui-context",json.header=innerChildNode.title,innerChildNode.description&&" "!=innerChildNode.description&&(json.subheader=innerChildNode.description),innerChildNode.setAttribute("data-webworks-context",JSON.stringify(json))),innerChildNode.trappedClick=innerChildNode.onclick,innerChildNode.onclick=void 0,innerChildNode.outerElement=this,innerChildNode.addEventListener("click",function(){innerChildNode.trappedClick&&(this.outerElement.selected=this,this.trappedClick&&setTimeout(this.trappedClick,0))},!1),innerChildNode.finishHighlight=function(){bb.screen.animating?setTimeout(this.finishHighlight,250):this.setAttribute("class",this.normal)},innerChildNode.finishHighlight=innerChildNode.finishHighlight.bind(innerChildNode),innerChildNode.parentList=this,innerChildNode.remove=function(){this.style.height="0px",this.style.opacity="0.0",this.style["-webkit-transition-property"]="all",this.style["-webkit-transition-duration"]="0.1s",this.style["-webkit-transition-timing-function"]="linear",this.style["-webkit-transform"]="translate3d(0,0,0)",bb.scroller&&bb.scroller.refresh(),window.setTimeout(this.details.performRemove,100)},innerChildNode.remove=innerChildNode.remove.bind(innerChildNode),details.performRemove=function(){var t=this.innerChildNode.parentList,e=t.items.indexOf(this.innerChildNode),i=this.innerChildNode.parentNode;i.removeChild(this.innerChildNode),t.items.splice(e,1)},details.performRemove=details.performRemove.bind(details),innerChildNode.getTitle=function(){return this.title},innerChildNode.getTitle=innerChildNode.getTitle.bind(innerChildNode),innerChildNode.getDescription=function(){return this.details.description.innerHTML},innerChildNode.getDescription=innerChildNode.getDescription.bind(innerChildNode),innerChildNode.getAccentText=function(){return this.details.accentText?this.details.accentText.innerHTML:void 0},innerChildNode.getAccentText=innerChildNode.getAccentText.bind(innerChildNode),innerChildNode.getImage=function(){return this.img},innerChildNode.getImage=innerChildNode.getImage.bind(innerChildNode))}},outerElement.styleItem=outerElement.styleItem.bind(outerElement),outerElement.appendItem=function(t){this.styleItem(t),this.appendChild(t),this.items.push(t);var e=document.createEvent("Events");e.initEvent("bbuilistready",!0,!0),document.dispatchEvent(e),bb.scroller&&bb.scroller.refresh()},outerElement.appendItem=outerElement.appendItem.bind(outerElement),outerElement.resetPadding=function(){this.style["padding-right"]="0px",this.timeout=null},outerElement.resetPadding=outerElement.resetPadding.bind(outerElement),outerElement.refresh=function(t){if(t&&t.length&&!(0>=t.length)){var e,i,n=document.createElement("div");for(this.items=[],e=0;t.length>e;e++)i=t[e],this.styleItem(i),this.items.push(i),n.appendChild(i);this.innerHTML="",this.appendChild(n);var o=document.createEvent("Events");o.initEvent("bbuilistready",!0,!0),document.dispatchEvent(o),bb.device.requiresScrollingHack&&(this.timeout?clearTimeout(this.timeout):this.style["padding-right"]="1px",this.timeout=setTimeout(this.resetPadding,20))}},outerElement.refresh=outerElement.refresh.bind(outerElement),outerElement.insertItemBefore=function(t,e){this.styleItem(t),e.parentNode.insertBefore(t,e),this.items.splice(this.items.indexOf(e),0,t);var i=document.createEvent("Events");i.initEvent("bbuilistready",!0,!0),document.dispatchEvent(i),bb.scroller&&bb.scroller.refresh()},outerElement.insertItemBefore=outerElement.insertItemBefore.bind(outerElement),outerElement.getItems=function(){var t,e=[];for(t=0;this.items.length>t;t++)e.push(this.items[t]);return e},outerElement.getItems=outerElement.getItems.bind(outerElement),outerElement.clear=function(){this.items=[],outerElement.innerHTML="",bb.scroller&&bb.scroller.refresh()},outerElement.clear=outerElement.clear.bind(outerElement),outerElement.show=function(){this.style.display="block",bb.refresh()},outerElement.show=outerElement.show.bind(outerElement),outerElement.hide=function(){this.style.display="none",bb.refresh()},outerElement.hide=outerElement.hide.bind(outerElement),outerElement.remove=function(){this.parentNode.removeChild(this),bb.refresh()},outerElement.remove=outerElement.remove.bind(outerElement),items=outerElement.querySelectorAll("[data-bb-type=item], [data-bb-type=header]");var item;for(j=0;items.length>j;j++)item=items[j],outerElement.styleItem(item),outerElement.items.push(item)}}},_bb10_labelControlContainers={apply:function(t){var e,i,n,o,r,s,a,l,b,d,c;for(e=0;t.length>e;e++){if(i=t[e],n=i.querySelectorAll("[data-bb-type=row]"),n.length>0)for(o=document.createElement("table"),o.setAttribute("class","bb-label-control-rows"),i.insertBefore(o,n[0]),r=0;n.length>r;r++)s=n[r],a=document.createElement("tr"),a.setAttribute("class","bb-label-control-label-row"),o.appendChild(a),l=document.createElement("td"),a.appendChild(l),b=s.querySelectorAll("[data-bb-type=label]")[0],b.setAttribute("class","bb-label-control-label"),s.removeChild(b),l.appendChild(b),a=document.createElement("tr"),o.appendChild(a),d=document.createElement("td"),a.appendChild(d),c=s.querySelectorAll("[data-bb-type=button],[data-bb-type=input],[data-bb-type=dropdown],textarea,input[type=file]")[0],c&&(s.removeChild(c),d.appendChild(c)),i.removeChild(s);i.show=function(){this.style.display="block",bb.refresh()},i.show=i.show.bind(i),i.hide=function(){this.style.display="none",bb.refresh()},i.hide=i.hide.bind(i),i.remove=function(){this.parentNode.removeChild(this),bb.refresh()},i.remove=i.remove.bind(i)}}},_bb10_pillButtons={apply:function(t){var e,i;for(e=0;t.length>e;e++)i=t[e],bb.pillButtons.style(i,!0)},style:function(t,e){var i,n,o,r,s,a,l,b="bb-pill-buttons-container bb-pill-buttons-container-"+bb.screen.controlColor,d="bb-pill-button",c=t.querySelectorAll("[data-bb-type=pill-button]"),h=Math.floor(100/c.length),u=10;for(bb.device.newerThan10dot2&&(b=b+" bb-pill-buttons-container-"+bb.screen.controlColor+"-10dot3"),t.sidePadding=u,t.setAttribute("class","bb-pill-buttons"),i=document.createElement("div"),t.appendChild(i),i.setAttribute("class",b),t.selectedColor=bb.device.newerThan10dot2?bb.options.highlightColor:"dark"==bb.screen.controlColor?"#909090":"#555555",pill=document.createElement("div"),pillInner=document.createElement("div"),pill.appendChild(pillInner),bb.device.newerThan10dot2?(pill.setAttribute("class",d+" bb-pill-button-selected-"+bb.screen.controlColor+"-10dot3 bb-pill-buttons-pill-10dot3"),pillInner.setAttribute("class","bb-pill-button-inner bb-pill-button-inner-selected-"+bb.screen.controlColor+"-10dot3")):(pill.setAttribute("class",d+" bb-pill-button-selected-"+bb.screen.controlColor+" bb-pill-buttons-pill"),pillInner.setAttribute("class","bb-pill-button-inner bb-pill-button-inner-selected-"+bb.screen.controlColor)),pill.style.opacity="0",t.pill=pill,i.appendChild(pill),t.style["padding-left"]=u+"px",t.style["padding-right"]=u+"px",r=document.createElement("table"),t.table=r,s=document.createElement("tr"),r.tr=s,r.appendChild(s),r.setAttribute("class","bb-pill-buttons-table"),r.style.opacity="0",i.appendChild(r),t.redrawBorders=function(){if(bb.device.newerThan10dot2!==!1){var t,e,i=this.table.querySelectorAll("td"),n=0;for(t=0;i.length>t;t++)e=i[t].innerChildNode,this.selected==e?(e.style["border-left"]="solid 2px transparent",e.style["border-radius"]="0px",n=t+1):n==t?(e.style["border-left"]="solid 2px transparent",e.style["border-radius"]="0px"):(e.style["border-left"]="light"==bb.screen.controlColor?"solid 2px #DCDCDC":"solid 2px #484848",e.style["border-radius"]="0px")}},t.redrawBorders=t.redrawBorders.bind(t),t.styleButton=function(e){return e.isSelected=!1,n=document.createElement("div"),n.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(n),e.border=n,e.outerElement=t,"true"==e.getAttribute("data-bb-selected")&&(e.isSelected=!0,t.selected=e,e.style.color=t.selectedColor),e.setAttribute("class",d),n.setAttribute("class","bb-pill-button-inner"),e.style["z-index"]=4,e.style.width="100%",e.dotouchstart=function(){if(!this.isSelected){var t=this.outerElement.selected;t.style.color="","light"==bb.screen.controlColor&&(this.outerElement.pill.style["background-color"]="#DDDDDD"),this.outerElement.setPillLeft(this)}},e.dotouchstart=e.dotouchstart.bind(e),e.dotouchend=function(){if(!this.isSelected){var t=this.outerElement.selected;t.isSelected=!1,this.isSelected=!0,this.outerElement.selected=this,this.style.color=this.outerElement.selectedColor,"light"==bb.screen.controlColor&&(this.outerElement.pill.style["background-color"]=""),this.outerElement.redrawBorders();var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0),e.doClick=!0,this.dispatchEvent(e)}},e.dotouchend=e.dotouchend.bind(e),bb.device.isRipple?(e.onmousedown=e.dotouchstart,e.onmouseup=e.dotouchend):(e.ontouchstart=e.dotouchstart,e.ontouchend=e.dotouchend),e.addEventListener("click",function(t){t.stopPropagation()},!0),e.setCaption=function(t){this.border.innerHTML=t},e.setCaption=e.setCaption.bind(e),e.getCaption=function(){return this.border.innerHTML},e.getCaption=e.getCaption.bind(e),e},t.styleButton=t.styleButton.bind(t),l=0;c.length>l;l++)o=c[l],o=t.styleButton(o),a=document.createElement("td"),s.appendChild(a),a.appendChild(o),a.innerChildNode=o,a.style.width=h+"%";return bb.device.newerThan10dot2&&t.redrawBorders(),t.recalculateSize=function(){var t,e=this.table.querySelectorAll("td"),i=parseInt(window.getComputedStyle(this).width)-this.sidePadding,n=Math.floor((i-4*e.length)/e.length)+"px";for(t=0;e.length>t;t++)e[t].style.width=n;this.table.style.width=i+"px",this.pill.style.width=n},t.recalculateSize=t.recalculateSize.bind(t),t.setPillLeft=function(t){if(!t&&(t=this.selected,!t)){var e=this.table.querySelectorAll("[data-bb-type=pill-button]");e.length>0&&(t=e[0],this.selected=t)}t&&(this.pill.style["-webkit-transform"]="translate3d("+t.parentNode.offsetLeft+"px,0px,0px)")},t.setPillLeft=t.setPillLeft.bind(t),t.initialize=function(){this.recalculateSize(),this.setPillLeft(),this.table.style.opacity="1",this.table.style["-webkit-transition"]="opacity 0.1s linear",this.pill.style.opacity="1"},t.initialize=t.initialize.bind(t),e?(t.onbbuidomready=function(){this.initialize(),document.removeEventListener("bbuidomprocessed",this.onbbuidomready,!1)},t.onbbuidomready=t.onbbuidomready.bind(t),document.addEventListener("bbuidomprocessed",t.onbbuidomready,!1)):window.setTimeout(t.initialize,0),t.doOrientationChange=function(){this.recalculateSize(),this.setPillLeft()},t.doOrientationChange=t.doOrientationChange.bind(t),window.addEventListener("resize",t.doOrientationChange,!1),bb.windowListeners.push({name:"resize",eventHandler:t.doOrientationChange}),t.show=function(){this.style.display="block",this.recalculateSize(),this.setPillLeft(),bb.refresh()},t.show=t.show.bind(t),t.hide=function(){this.style.display="none",bb.refresh()},t.hide=t.hide.bind(t),t.remove=function(){this.parentNode.removeChild(this),bb.refresh()},t.remove=t.remove.bind(t),t.clear=function(){var t,e=this.table.querySelectorAll("td");for(t=0;e.length>t;t++)this.table.tr.removeChild(e[t]);this.pill.style.opacity="0"},t.clear=t.clear.bind(t),t.appendButton=function(e){e=t.styleButton(e);var i=document.createElement("td");this.table.tr.appendChild(i),i.appendChild(e),this.initialize(),this.redrawBorders()},t.appendButton=t.appendButton.bind(t),t.getButtons=function(){for(var t=this.parentNode.querySelectorAll("[data-bb-type=pill-button]"),e=Array(),i=0;t.length>i;i++)e[i]=t[i].firstChild.innerHTML;return e},t.getButtons=t.getButtons.bind(t),t}},_bb10_radio={apply:function(t){for(var e=0;t.length>e;e++)bb.radio.style(t[e])},style:function(t){var t,e,i,n=bb.screen.controlColor,o=t;return t=document.createElement("div"),t.setAttribute("class","bb-radio-container-"+n),bb.device.newerThan10dot2===!0&&t.setAttribute("class","bb-radio-container-"+n+" bb-radio-container-10dot3-"+n),t.input=o,o.outerElement=t,o.style.display="none",o.radio=t,o.parentNode&&o.parentNode.insertBefore(t,o),t.appendChild(o),e=document.createElement("div"),bb.device.newerThan10dot2===!0?(e.setAttribute("class","bb-radio-dot bb-radio-dot-10dot3 bb-radio-dot-10dot3-"+n),e.highlight="-webkit-linear-gradient(top, "+bb.options.highlightColor+" , "+bb.options.highlightColor+")",e.touchHighlight="light"==n?"-webkit-linear-gradient(top, #C6C6C6 , #C6C6C6)":"-webkit-linear-gradient(top, #303030 , #303030)"):(e.setAttribute("class","bb-radio-dot"),e.highlight="-webkit-linear-gradient(top, rgb("+(bb.options.shades.R+32)+", "+(bb.options.shades.G+32)+", "+(bb.options.shades.B+32)+") 0%, rgb("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+") 100%)",e.touchHighlight="-webkit-linear-gradient(top, rgba("+(bb.options.shades.R-64)+", "+(bb.options.shades.G-64)+", "+(bb.options.shades.B-64)+",0.25) 0%, rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+",0.25) 100%)"),o.checked&&(e.style.background=e.highlight),t.dotDiv=e,t.appendChild(e),i=document.createElement("div"),bb.device.newerThan10dot2===!0?i.setAttribute("class","bb-radio-dot-center bb-radio-dot-center-10dot3"):i.setAttribute("class","bb-radio-dot-center"),o.checked||bb.radio.resetDot(i),e.appendChild(i),e.centerDotDiv=i,e.slideOutUp=function(){1!=bb.device.newerThan10dot2?bb.device.is1024x600?(this.style.height="0px",this.style.width="10px",this.style.top="9px",this.style.left="15px"):(this.style.height="0px",this.style.width="20px",this.style.top="18px",this.style.left="30px"):this.style.background="",bb.radio.resetDot(this.centerDotDiv),this.style["-webkit-transition-property"]="all",this.style["-webkit-transition-duration"]="0.1s",this.style["-webkit-transition-timing-function"]="linear",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]=1e3,this.style["-webkit-transform"]="translate3d(0,0,0)"},e.slideOutUp=e.slideOutUp.bind(e),e.slideOutDown=function(){1!=bb.device.newerThan10dot2?bb.device.is1024x600?(this.style.height="0px",this.style.width="10px",this.style.top="30px",this.style.left="15px"):(this.style.height="0px",this.style.width="20px",this.style.top="60px",this.style.left="30px"):this.style.background="",bb.radio.resetDot(this.centerDotDiv),this.style["-webkit-transition-property"]="all",this.style["-webkit-transition-duration"]="0.1s",this.style["-webkit-transition-timing-function"]="linear",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]=1e3,this.style["-webkit-transform"]="translate3d(0,0,0)"},e.slideOutDown=e.slideOutDown.bind(e),e.slideIn=function(){1!=bb.device.newerThan10dot2?bb.device.is1024x600?(this.style.height="20px",this.style.width="20px",this.style.top="10px",this.style.left="9px",this.centerDotDiv.style.height="10px",this.centerDotDiv.style.width="10px",this.centerDotDiv.style.top="5px",this.centerDotDiv.style.left="5px"):(this.style.height="40px",this.style.width="40px",this.style.top="19px",this.style.left="19px",this.centerDotDiv.style.height="18px",this.centerDotDiv.style.width="18px",this.centerDotDiv.style.top="11px",this.centerDotDiv.style.left="11px"):this.centerDotDiv.style.opacity="1.0",this.style["-webkit-transition-property"]="all",this.style["-webkit-transition-duration"]="0.1s",this.style["-webkit-transition-timing-function"]="ease-in",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]=1e3,this.style["-webkit-transform"]="translate3d(0,0,0)",this.centerDotDiv.style["-webkit-transition-delay"]="0.1s",this.centerDotDiv.style["-webkit-transition-property"]="all",this.centerDotDiv.style["-webkit-transition-duration"]="0.1s",this.centerDotDiv.style["-webkit-transition-timing-function"]="ease-in",this.centerDotDiv.style["-webkit-perspective"]=1e3,this.centerDotDiv.style["-webkit-transform"]="translate3d(0,0,0)"},e.slideIn=e.slideIn.bind(e),t.selectedRadio=void 0,t.slideFromTop=!0,t.ontouchstart=function(){this.input.checked||(this.slideFromTop=!0,this.selectedRadio=this.getCurrentlyChecked(),this.selectedRadio&&this.getTop(this.selectedRadio.radio)>=this.getTop(this)&&(this.slideFromTop=!1),this.dotDiv.style["-webkit-transition"]="none",1!=bb.device.newerThan10dot2&&(bb.device.is1024x600?(this.dotDiv.style.height="20px",this.dotDiv.style.width="20px",this.dotDiv.style.top="10px",this.dotDiv.style.left="9px"):(this.dotDiv.style.height="40px",this.dotDiv.style.width="40px",this.dotDiv.style.top="19px",this.dotDiv.style.left="19px")),bb.radio.resetDot(this.dotDiv.centerDotDiv),this.dotDiv.style.background=this.dotDiv.touchHighlight)},t.ontouchend=function(){this.input.checked||(this.dotDiv.style["-webkit-transition"]="none",1!=bb.device.newerThan10dot2?(bb.device.is1024x600?(this.dotDiv.style.height="0px",this.dotDiv.style.width="9px",this.dotDiv.style.left="16px"):(this.dotDiv.style.height="0px",this.dotDiv.style.width="18px",this.dotDiv.style.left="32px"),this.dotDiv.style.top=this.slideFromTop?bb.device.is1024x600?"9px":"18px":bb.device.is1024x600?"30px":"60px"):this.dotDiv.style.background="",window.setTimeout(this.doclick,0))},t.doclick=function(){if(!this.input.checked&&!this.input.disabled){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0),this.dotDiv.style.background=this.dotDiv.highlight,this.dotDiv.slideIn(),this.selectedRadio&&(this.selectedRadio.removeAttribute("checked"),this.selectedRadio.dispatchEvent(t),this.slideFromTop?this.selectedRadio.radio.dotDiv.slideOutDown():this.selectedRadio.radio.dotDiv.slideOutUp()),this.input.setAttribute("checked","true"),this.input.dispatchEvent(t)}},t.doclick=t.doclick.bind(t),t.getCurrentlyChecked=function(){var t=document.querySelectorAll("input[type=radio][name="+this.input.name+"][checked=true]");return t.length>0?t[0]:void 0},t.getCurrentlyChecked=t.getCurrentlyChecked.bind(t),t.getTop=function(t){for(var e=0;t;)e+=t.offsetTop,t=t.offsetParent;return e},o.setChecked=function(){this.checked||(this.slideFromTop=!0,this.outerElement.selectedRadio=this.outerElement.getCurrentlyChecked(),this.outerElement.selectedRadio&&this.outerElement.getTop(this.outerElement.selectedRadio.radio)>=this.outerElement.getTop(this.outerElement)&&(this.outerElement.slideFromTop=!1),this.outerElement.dotDiv.style["-webkit-transition"]="none",1!=bb.device.newerThan10dot2?(bb.device.is1024x600?(this.outerElement.dotDiv.style.height="0px",this.outerElement.dotDiv.style.width="9px",this.outerElement.dotDiv.style.left="16px"):(this.outerElement.dotDiv.style.height="0px",this.outerElement.dotDiv.style.width="18px",this.outerElement.dotDiv.style.left="32px"),this.outerElement.dotDiv.style.top=this.outerElement.slideFromTop?bb.device.is1024x600?"9px":"18px":bb.device.is1024x600?"30px":"60px"):(this.outerElement.dotDiv.style.background="",this.outerElement.dotDiv.centerDotDiv.style.opacity="0.0"),window.setTimeout(this.outerElement.doclick,0))},o.setChecked=o.setChecked.bind(o),o.getChecked=function(){return this.checked},o.setChecked=o.setChecked.bind(o),o.enable=function(){this.disabled&&(this.disabled=!1,bb.device.newerThan10dot2===!0?this.outerElement.dotDiv.setAttribute("class","bb-radio-dot bb-radio-dot-10dot3 bb-radio-dot-10dot3-"+bb.screen.controlColor):this.outerElement.dotDiv.setAttribute("class","bb-radio-dot"))},o.enable=o.enable.bind(o),o.disable=function(){this.disabled||(this.disabled=!0,bb.device.newerThan10dot2===!0?this.outerElement.dotDiv.setAttribute("class","bb-radio-dot-disabled bb-radio-dot-disabled-10dot3"):this.outerElement.dotDiv.setAttribute("class","bb-radio-dot-disabled"))},o.disable=o.disable.bind(o),o.isEnabled=function(){return!this.disabled},o.isEnabled=o.isEnabled.bind(o),o.show=function(){this.outerElement.style.display="block",bb.refresh()},o.show=o.show.bind(o),o.hide=function(){this.outerElement.style.display="none",bb.refresh()},o.hide=o.hide.bind(o),o.remove=function(){this.outerElement.parentNode.removeChild(this.outerElement),bb.refresh()},o.remove=o.remove.bind(o),t},resetDot:function(t){t.style["-webkit-transition"]="none",1!=bb.device.newerThan10dot2?bb.device.is1024x600?(t.style.height="0px",t.style.width="0px",t.style.top="10px",t.style.left="9px"):(t.style.height="0px",t.style.width="0px",t.style.top="20px",t.style.left="20px"):t.style.opacity="0.0"},enableGroup:function(t){var e=document.getElementsByName(t);for(i=0;e.length>i;i++)"radio"===e[i].type&&e[i].enable()},disableGroup:function(t){var e=document.getElementsByName(t);for(i=0;e.length>i;i++)"radio"===e[i].type&&e[i].disable()}},_bb10_roundPanel={apply:function(t){var e,i,n,o,r,s=bb.screen.listColor;for(e=0;t.length>e;e++){for(n=t[e],n.setAttribute("class","bb-round-panel"),o=n.querySelectorAll("[data-bb-type=panel-header]"),i=0;o.length>i;i++)r=o[i],bb.device.newerThan10dot2?r.setAttribute("class","bb-panel-header bb-panel-header-"+s+" bb-panel-header-10dot3 bb-panel-header-"+s+"-10dot3"):(r.setAttribute("class","bb-panel-header bb-panel-header-"+s),r.style["border-bottom-color"]=bb.options.shades.darkOutline);n.show=function(){this.style.display="block",bb.refresh()},n.show=n.show.bind(n),n.hide=function(){this.style.display="none",bb.refresh()},n.hide=n.hide.bind(n),n.remove=function(){this.parentNode.removeChild(this),bb.refresh()},n.remove=n.remove.bind(n)}}},_bb10_slider={apply:function(t){var e,i,n=bb.screen.controlColor;for(e=0;t.length>e;e++)i=t[e],outerElement=document.createElement("div"),outerElement.range=i,i.parentNode.insertBefore(outerElement,i),i.style.display="none",outerElement.appendChild(i),outerElement.minValue=i.hasAttribute("min")?parseInt(i.getAttribute("min")):0,outerElement.maxValue=i.hasAttribute("max")?parseInt(i.getAttribute("max")):0,outerElement.value=i.hasAttribute("value")?parseInt(i.getAttribute("value")):0,outerElement.step=i.hasAttribute("step")?parseInt(i.getAttribute("step")):0,outerElement.isActivated=!1,outerElement.initialXPos=0,outerElement.currentXPos=0,outerElement.transientXPos=0,outerElement.className="bb-slider",outerElement.outer=document.createElement("div"),bb.device.newerThan10dot2===!0?outerElement.outer.setAttribute("class","outer outer-10dot3 bb-slider-outer-"+n+" bb-slider-outer-10dot3-"+n):outerElement.outer.setAttribute("class","outer bb-slider-outer-"+n),outerElement.appendChild(outerElement.outer),outerElement.fill=document.createElement("div"),outerElement.fill.className="fill",bb.device.newerThan10dot2===!0?(outerElement.fill.active=bb.options.highlightColor,outerElement.fill.dormant=bb.options.highlightColor):(outerElement.fill.active="-webkit-linear-gradient(top, rgb("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+") 0%, rgb("+(bb.options.shades.R+16)+", "+(bb.options.shades.G+16)+", "+(bb.options.shades.B+16)+") 100%)",outerElement.fill.dormant="-webkit-linear-gradient(top, "+bb.options.highlightColor+" 0%, "+bb.options.shades.darkHighlight+" 100%)"),outerElement.fill.style.background=outerElement.fill.dormant,outerElement.outer.appendChild(outerElement.fill),outerElement.inner=document.createElement("div"),outerElement.inner.className="inner",outerElement.inner.outerElement=outerElement,outerElement.outer.appendChild(outerElement.inner),outerElement.halo=document.createElement("div"),bb.device.newerThan10dot2===!0?(outerElement.halo.style.background="light"==n?"#C3C3C3":"#484848",outerElement.halo.className="halo halo-10dot3"):(outerElement.halo.style.background="-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 43, from(rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.15)), color-stop(0.8, rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.15)), to(rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.7)))",outerElement.halo.className="halo"),outerElement.inner.appendChild(outerElement.halo),outerElement.indicator=document.createElement("div"),bb.device.newerThan10dot2===!0?outerElement.indicator.setAttribute("class","indicator indicator-10dot3 bb-slider-indicator-10dot3-"+n):outerElement.indicator.setAttribute("class","indicator bb-slider-indicator-"+n),outerElement.inner.appendChild(outerElement.indicator),i.outerElement=outerElement,i.setValue=function(t){var e,i=0;t&&(parseInt(this.outerElement.minValue)>t||t>parseInt(this.outerElement.maxValue))||(t&&(this.outerElement.value=t,this.value=t,e=document.createEvent("HTMLEvents"),e.initEvent("change",!1,!0),this.dispatchEvent(e)),i=this.outerElement.value==this.outerElement.maxValue?1:this.outerElement.value/(parseInt(this.outerElement.maxValue)+parseInt(this.outerElement.minValue)),this.outerElement.currentXPos=Math.floor(parseInt(window.getComputedStyle(this.outerElement.outer).width)*i),this.outerElement.fill.style.width=this.outerElement.currentXPos+"px",this.outerElement.inner.style["-webkit-transform"]="translate3d("+this.outerElement.currentXPos+"px,0px,0px)")},i.setValue=i.setValue.bind(i),window.setTimeout(i.setValue,0),outerElement.inner.animateBegin=function(t){this.outerElement.isActivated===!1&&(this.outerElement.isActivated=!0,this.outerElement.initialXPos=t.touches[0].pageX,this.outerElement.halo.style["-webkit-transform"]="scale(1)",this.outerElement.halo.style["-webkit-animation-name"]="explode",bb.device.newerThan10dot2===!0?(this.outerElement.indicator.setAttribute("class","indicator indicator-10dot3 bb-slider-indicator-10dot3-"+n+" indicator-hover-10dot3-"+n),this.outerElement.indicator.style.background="#FEFEFE"):(this.outerElement.indicator.setAttribute("class","indicator bb-slider-indicator-"+n+" indicator-hover-"+n),this.outerElement.indicator.style.background="-webkit-linear-gradient(top, rgb("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+") 0%, rgb("+(bb.options.shades.R+16)+", "+(bb.options.shades.G+16)+", "+(bb.options.shades.B+16)+") 100%)"),this.outerElement.fill.style.background=this.outerElement.fill.active)},outerElement.inner.animateBegin=outerElement.inner.animateBegin.bind(outerElement.inner),outerElement.inner.addEventListener("touchstart",outerElement.inner.animateBegin,!1),outerElement.inner.animateEnd=function(){this.outerElement.isActivated===!0&&(this.outerElement.isActivated=!1,this.outerElement.currentXPos=this.outerElement.transientXPos,this.outerElement.value=parseInt(this.outerElement.range.value),this.outerElement.halo.style["-webkit-transform"]="scale(0)",this.outerElement.halo.style["-webkit-animation-name"]="implode",bb.device.newerThan10dot2===!0?this.outerElement.indicator.setAttribute("class","indicator indicator-10dot3 bb-slider-indicator-10dot3-"+n):this.outerElement.indicator.setAttribute("class","indicator bb-slider-indicator-"+n),this.outerElement.indicator.style.background="",this.outerElement.fill.style.background=this.outerElement.fill.dormant)},outerElement.inner.animateEnd=outerElement.inner.animateEnd.bind(outerElement.inner),outerElement.inner.addEventListener("touchend",outerElement.inner.animateEnd,!1),outerElement.moveSlider=function(t){this.isActivated===!0&&(t.stopPropagation(),t.preventDefault(),this.transientXPos=this.currentXPos+t.touches[0].pageX-this.initialXPos,this.transientXPos=Math.max(0,Math.min(this.transientXPos,parseInt(window.getComputedStyle(this.outer).width))),this.notifyUpdated(),this.fill.style.width=this.transientXPos+"px",this.inner.style["-webkit-transform"]="translate3d("+this.transientXPos+"px,0px,0px)")},outerElement.moveSlider=outerElement.moveSlider.bind(outerElement),outerElement.notifyUpdated=function(){var t=this.transientXPos/parseInt(window.getComputedStyle(this.outer).width),e=Math.ceil((parseInt(this.minValue)+parseInt(this.maxValue))*t);
if(Math.abs(e-parseInt(this.range.value))>this.step){this.range.value=e;var i=document.createEvent("HTMLEvents");i.initEvent("change",!1,!0),this.range.dispatchEvent(i)}},outerElement.notifyUpdated=outerElement.notifyUpdated.bind(outerElement),outerElement.doOrientationChange=function(){window.setTimeout(outerElement.range.setValue,0)},outerElement.doOrientationChange=outerElement.doOrientationChange.bind(outerElement),document.addEventListener("touchmove",outerElement.moveSlider,!1),bb.documentListeners.push({name:"touchmove",eventHandler:outerElement.moveSlider}),document.addEventListener("touchend",outerElement.inner.animateEnd,!1),bb.documentListeners.push({name:"touchend",eventHandler:outerElement.inner.animateEnd}),window.addEventListener("resize",outerElement.doOrientationChange,!1),bb.windowListeners.push({name:"resize",eventHandler:outerElement.doOrientationChange})}},_bb10_textInput={apply:function(t){for(var e=0;t.length>e;e++)bb.textInput.style(t[e])},style:function(t){var e="",i=document.createElement("div");if(t.hasAttribute("class")&&(e=t.getAttribute("class")),t.parentNode&&t.parentNode.insertBefore(i,t),i.appendChild(t),i.input=t,i.setAttribute("data-bb-type","input"),i.normal="bb-input-container",t.normal=e+" bb-input",t.focused=e+" bb-input bb-input-focused",bb.device.newerThan10dot2&&(i.normal+=" bb-input-container-10dot3 bb-input-container-10dot3-"+bb.screen.controlColor,t.normal+=" bb-input-10dot3 bb-input-10dot3-"+bb.screen.controlColor,t.focused+=" bb-input-10dot3 bb-input-10dot3-"+bb.screen.controlColor+" bb-input-focused-10dot3"),t.disabled?bb.device.newerThan10dot2?t.setAttribute("class",t.normal+" bb-input-disabled-10dot3-"+bb.screen.controlColor):t.setAttribute("class",t.normal+" bb-input-disabled"):t.setAttribute("class",t.normal),t.isFocused=!1,t.clickCount=0,t.container=i,t.clearBtn="none"!=t.getAttribute("data-bb-clear"),t.hasClearBtn=!1,t.type){var n=t.type.toLowerCase();("date"==n||"time"==n||"datetime"==n||"month"==n||"datetime-local"==n||"color"==n||"search"==n)&&(t.clearBtn=!1,bb.device.newerThan10dot1&&(i.style.padding="0px",i.style["border-width"]="0px",i.style["background-color"]="transparent"))}return t.disabled?i.setAttribute("class",i.normal+" bb-input-container-disabled"):i.setAttribute("class",i.normal),t.doFocus=function(){0==this.readOnly&&(bb.device.newerThan10dot2?this.container.setAttribute("class",this.container.normal+" bb-input-cancel-button-"+bb.screen.controlColor+" bb-input-container-focused bb-input-container-focused-10dot3 bb-input-container-focused-10dot3-"+bb.screen.controlColor):this.container.setAttribute("class",this.container.normal+" bb-input-cancel-button-light bb-input-container-focused"),this.clearBtn&&this.value?(this.setAttribute("class",this.focused),this.hasClearBtn=!0):(this.setAttribute("class",this.normal),this.hasClearBtn=!1),this.container.style["border-color"]=bb.options.highlightColor,this.isFocused=!0,this.clickCount=0,bb.screen.focusedInput=this)},t.doFocus=t.doFocus.bind(t),t.addEventListener("focus",t.doFocus,!1),t.doBlur=function(){this.container.setAttribute("class",this.container.normal),this.clearBtn&&this.setAttribute("class",this.normal),this.container.style["border-color"]="",this.isFocused=!1,bb.screen.focusedInput=null},t.doBlur=t.doBlur.bind(t),t.addEventListener("blur",t.doBlur,!1),t.updateClearButton=function(){this.clearBtn&&(0==this.value.length&&this.hasClearBtn||this.value.length>0&&!this.hasClearBtn)&&t.doFocus()},t.updateClearButton=t.updateClearButton.bind(t),t.addEventListener("input",t.updateClearButton,!1),t.clearBtn&&(t.container.ontouchstart=function(e){if(e.target==this){e.preventDefault(),e.stopPropagation(),this.input.value="",t.doFocus();var i=document.createEvent("HTMLEvents");i.initEvent("change",!1,!0),this.input.dispatchEvent(i)}}),t.show=function(){this.container.style.display=""},t.show=t.show.bind(t),t.hide=function(){this.container.style.display="none"},t.hide=t.hide.bind(t),t.remove=function(){this.container.parentNode&&this.container.parentNode.removeChild(this.container)},t.remove=t.remove.bind(t),t.enable=function(){this.disabled&&(this.disabled=!1,this.container.setAttribute("class",this.container.normal),this.setAttribute("class",this.normal))},t.enable=t.enable.bind(t),t.disable=function(){this.disabled||(this.disabled=!0,bb.device.newerThan10dot2?(this.container.setAttribute("class",this.container.normal+" bb-input-container-disabled-10dot3-"+bb.screen.controlColor),this.setAttribute("class",this.normal+" bb-input-disabled-10dot3-"+bb.screen.controlColor)):(this.container.setAttribute("class",this.container.normal+" bb-input-container-disabled"),this.setAttribute("class",this.normal+" bb-input-disabled")))},t.disable=t.disable.bind(t),i}},_bb10_toggle={apply:function(t){for(var e=0;t.length>e;e++)bb.toggle.style(t[e],!0)},style:function(outerElement,offdom){var table,tr,td,color=bb.screen.controlColor;return outerElement.checked=!1,outerElement.enabled=!0,outerElement.buffer=bb.device.is1024x600?35:70,bb.device.newerThan10dot2===!0&&(bb.device.is1280x720?outerElement.buffer=57:bb.device.is720x720&&(outerElement.buffer=63)),outerElement.isActivated=!1,outerElement.initialXPos=0,outerElement.currentXPos=0,outerElement.transientXPos=0,outerElement.movedWithSlider=!1,outerElement.startValue=!1,outerElement.hasAttribute("data-bb-disabled")&&(outerElement.enabled=!("true"==outerElement.getAttribute("data-bb-disabled").toLowerCase())),outerElement.className=bb.device.newerThan10dot2===!0?"bb-toggle bb-toggle-10dot3":"bb-toggle",outerElement.outer=document.createElement("div"),outerElement.normal=outerElement.enabled?bb.device.newerThan10dot2===!0?"outer outer-10dot3 bb-toggle-outer-enabled-"+color:bb.device.newerThan10dot1===!0?"outer bb-toggle-outer-"+color+"-10dot2 bb-toggle-outer-enabled-"+color:"outer bb-toggle-outer-"+color+" bb-toggle-outer-enabled-"+color:"outer bb-toggle-outer-"+color+" bb-toggle-outer-disabled",outerElement.outer.setAttribute("class",outerElement.normal),outerElement.appendChild(outerElement.outer),outerElement.fill=document.createElement("div"),outerElement.fill.className=bb.device.newerThan10dot2===!0?"fill fill-10dot3-"+color:"fill",outerElement.fill.style.background=outerElement.fill.dormant,outerElement.outer.appendChild(outerElement.fill),outerElement.inner=document.createElement("div"),outerElement.inner.className="inner",outerElement.inner.outerElement=outerElement,outerElement.fill.appendChild(outerElement.inner),table=document.createElement("table"),table.className="table",tr=document.createElement("tr"),table.appendChild(tr),outerElement.inner.appendChild(table),td=document.createElement("td"),td.className="left",tr.appendChild(td),outerElement.yes=document.createElement("div"),outerElement.yes.className="yes",outerElement.yes.innerHTML=outerElement.getAttribute("data-bb-on"),td.appendChild(outerElement.yes),td=document.createElement("td"),td.className="center",tr.appendChild(td),td=document.createElement("td"),td.className="right",tr.appendChild(td),outerElement.no=document.createElement("div"),outerElement.no.className="no",outerElement.no.innerHTML=outerElement.getAttribute("data-bb-off"),td.appendChild(outerElement.no),outerElement.container=document.createElement("div"),outerElement.container.className="indicator-container",outerElement.appendChild(outerElement.container),outerElement.halo=document.createElement("div"),bb.device.newerThan10dot2===!0?(outerElement.halo.style.background="light"==color?"#C3C3C3":"#484848",outerElement.halo.className="halo halo-10dot3"):(outerElement.halo.className="halo",outerElement.halo.style.background="-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 43, from(rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.15)), color-stop(0.8, rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.15)), to(rgba("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+", 0.7)))"),outerElement.container.appendChild(outerElement.halo),outerElement.indicator=document.createElement("div"),outerElement.indicator.normal=outerElement.enabled?"indicator bb-toggle-indicator-enabled-"+color:"indicator bb-toggle-indicator-disabled-"+color,outerElement.indicator.setAttribute("class",outerElement.indicator.normal),outerElement.container.appendChild(outerElement.indicator),bb.device.newerThan10dot2===!0&&(outerElement.onoff=document.createElement("div"),outerElement.onoff.className="switch-off-"+color,outerElement.indicator.appendChild(outerElement.onoff)),outerElement.hasAttribute("onchange")&&(outerElement.onchangeEval=outerElement.getAttribute("onchange"),outerElement.onchange=function(){eval(this.onchangeEval)}),outerElement.inner.animateBegin=function(t){this.outerElement.enabled&&this.outerElement.isActivated===!1&&(this.outerElement.startValue=this.outerElement.checked,this.outerElement.movedWithSlider=!1,this.outerElement.isActivated=!0,this.outerElement.initialXPos=t.touches[0].pageX,this.outerElement.halo.style["-webkit-transform"]="scale(1)",this.outerElement.halo.style["-webkit-animation-name"]="explode",1==bb.device.newerThan10dot2?this.outerElement.indicator.setAttribute("class","indicator bb-toggle-indicator-enabled-"+color+" indicator-hover-"+color):(this.outerElement.indicator.setAttribute("class","indicator bb-toggle-indicator-enabled-"+color+" indicator-hover-"+color),this.outerElement.indicator.style.background="-webkit-linear-gradient(top, rgb("+bb.options.shades.R+", "+bb.options.shades.G+", "+bb.options.shades.B+") 0%, rgb("+(bb.options.shades.R+16)+", "+(bb.options.shades.G+16)+", "+(bb.options.shades.B+16)+") 100%)"))},outerElement.inner.animateBegin=outerElement.inner.animateBegin.bind(outerElement.inner),outerElement.inner.addEventListener("touchstart",outerElement.inner.animateBegin,!1),outerElement.container.addEventListener("touchstart",outerElement.inner.animateBegin,!1),outerElement.inner.animateEnd=function(){this.outerElement.enabled&&this.outerElement.isActivated===!0&&(this.outerElement.isActivated=!1,this.outerElement.currentXPos=this.outerElement.transientXPos,this.outerElement.halo.style["-webkit-transform"]="scale(0)",this.outerElement.halo.style["-webkit-animation-name"]="implode",this.outerElement.indicator.setAttribute("class","indicator bb-toggle-indicator-enabled-"+color),this.outerElement.indicator.style.background="",this.outerElement.positionButton(),this.outerElement.movedWithSlider&&this.outerElement.startValue!=this.outerElement.checked&&this.outerElement.onchange&&this.outerElement.onchange())},outerElement.inner.animateEnd=outerElement.inner.animateEnd.bind(outerElement.inner),outerElement.addEventListener("touchend",outerElement.inner.animateEnd,!1),outerElement.moveToggle=function(t){if(this.enabled&&this.isActivated===!0){this.movedWithSlider=!0,t.stopPropagation(),t.preventDefault();var e,i=parseInt(window.getComputedStyle(this.fill).width)-this.buffer;this.transientXPos=this.currentXPos+t.touches[0].pageX-this.initialXPos,this.transientXPos=Math.max(0,Math.min(this.transientXPos,i)),this.inner.style["-webkit-transform"]="translate3d("+this.transientXPos+"px,0px,0px)",this.container.style["-webkit-transform"]="translate3d("+this.transientXPos+"px,0px,0px)",e=this.transientXPos/i,this.checked=e>.5}},outerElement.moveToggle=outerElement.moveToggle.bind(outerElement),outerElement.doClick=function(){this.enabled&&(this.movedWithSlider||this.setChecked(!this.checked))},outerElement.doClick=outerElement.doClick.bind(outerElement),outerElement.addEventListener("click",outerElement.doClick,!1),outerElement.positionButton=function(){var t=this.checked?parseInt(window.getComputedStyle(this.fill).width)-this.buffer:0;this.inner.style["-webkit-transform"]="translate3d("+t+"px,0px,0px)",this.inner.style["-webkit-transition-duration"]="0.1s",this.inner.style["-webkit-transition-timing-function"]="linear",this.inner.addEventListener("webkitTransitionEnd",function(){this.style["-webkit-transition"]=""}),this.container.style["-webkit-transform"]="translate3d("+t+"px,0px,0px)",this.container.style["-webkit-transition-duration"]="0.1s",this.container.style["-webkit-transition-timing-function"]="linear",this.container.addEventListener("webkitTransitionEnd",function(){this.style["-webkit-transition"]=""}),this.checked&&this.enabled?bb.device.newerThan10dot2?(this.indicator.style.background="#FEFEFE",this.indicator.style.border="1px solid #FEFEFE",this.fill.style.background=bb.options.highlightColor,this.onoff.className="switch-on",this.onoff.style["background-color"]=bb.options.highlightColor):this.indicator.style["background-image"]="-webkit-linear-gradient(top, "+bb.options.highlightColor+" 0%, "+bb.options.shades.darkHighlight+" 100%)":bb.device.newerThan10dot2?this.checked===!1&&(this.fill.style.background="",this.onoff.className="switch-off-"+bb.screen.controlColor,this.onoff.style["background-color"]="",this.indicator.style.background="",this.indicator.style.border=""):this.indicator.style["background-image"]="",this.currentXPos=t},outerElement.positionButton=outerElement.positionButton.bind(outerElement),outerElement.setChecked=function(t){t!=this.checked&&(this.checked=t,this.onchange&&this.onchange()),this.positionButton()},outerElement.setChecked=outerElement.setChecked.bind(outerElement),outerElement.getChecked=function(){return this.checked},outerElement.getChecked=outerElement.getChecked.bind(outerElement),outerElement.show=function(){this.style.display="block",bb.refresh()},outerElement.show=outerElement.show.bind(outerElement),outerElement.hide=function(){this.style.display="none",bb.refresh()},outerElement.hide=outerElement.hide.bind(outerElement),outerElement.remove=function(){this.parentNode.removeChild(this),bb.refresh()},outerElement.remove=outerElement.remove.bind(outerElement),outerElement.setOnCaption=function(t){this.yes.innerHTML=t},outerElement.setOnCaption=outerElement.setOnCaption.bind(outerElement),outerElement.setOffCaption=function(t){this.no.innerHTML=t},outerElement.setOffCaption=outerElement.setOffCaption.bind(outerElement),outerElement.getOnCaption=function(){return this.yes.innerHTML},outerElement.getOnCaption=outerElement.getOnCaption.bind(outerElement),outerElement.getOffCaption=function(){return this.no.innerHTML},outerElement.getOffCaption=outerElement.getOffCaption.bind(outerElement),outerElement.enable=function(){this.enabled||(this.enabled=!0,bb.device.newerThan10dot2===!0?this.style.opacity="":(this.indicator.normal="indicator bb-toggle-indicator-enabled-"+color,this.indicator.setAttribute("class",this.indicator.normal),this.normal=bb.device.newerThan10dot1?"outer bb-toggle-outer-"+color+"-10dot2 bb-toggle-outer-enabled-"+color:"outer bb-toggle-outer-"+color+" bb-toggle-outer-enabled-"+color,this.outer.setAttribute("class",this.normal)),this.positionButton())},outerElement.enable=outerElement.enable.bind(outerElement),outerElement.disable=function(){this.enabled&&(this.enabled=!1,bb.device.newerThan10dot2===!0?this.style.opacity="0.45":(this.indicator.normal="indicator bb-toggle-indicator-disabled-"+color,this.indicator.setAttribute("class",this.indicator.normal),this.normal="outer bb-toggle-outer-"+color+" bb-toggle-outer-disabled",this.outer.setAttribute("class",this.normal)),this.positionButton())},outerElement.disable=outerElement.disable.bind(outerElement),outerElement.checked=outerElement.hasAttribute("data-bb-checked")?"true"==outerElement.getAttribute("data-bb-checked").toLowerCase():!1,offdom?(outerElement.onbbuidomready=function(){this.positionButton(),document.removeEventListener("bbuidomready",this.onbbuidomready,!1)},outerElement.onbbuidomready=outerElement.onbbuidomready.bind(outerElement),document.addEventListener("bbuidomready",outerElement.onbbuidomready,!1)):setTimeout(outerElement.positionButton,0),document.addEventListener("touchmove",outerElement.moveToggle,!1),bb.documentListeners.push({name:"touchmove",eventHandler:outerElement.moveToggle}),document.addEventListener("touchend",outerElement.inner.animateEnd,!1),bb.documentListeners.push({name:"touchend",eventHandler:outerElement.inner.animateEnd}),outerElement}},_bb_PlayBook_10_scrollPanel={apply:function(t){var e,i,n,o,r;for(e=0;t.length>e;e++){for(n=t[e],r=[],o=document.createElement("div"),n.appendChild(o),i=0;n.childNodes.length-1>i;i++)r.push(n.childNodes[i]);for(i=0;r.length>i;i++)o.appendChild(r[i]);bb.device.isPlayBook?n.scroller=new iScroll(n,{vScrollbar:!0,hideScrollbar:!0,fadeScrollbar:!0,onBeforeScrollStart:function(t){bb.scroller&&bb.scroller.disable(),t.preventDefault()},onBeforeScrollEnd:function(){bb.scroller&&bb.scroller.enable()},onScrollEnd:function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)},onScrollMove:function(t){n.onscroll&&n.onscroll(t),evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)}}):(n.scroller=null,n.style["-webkit-overflow-scrolling"]="-blackberry-touch",n.addEventListener("scroll",function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt),this.timeout?clearTimeout(this.timeout):this.style["padding-right"]="1px",this.timeout=setTimeout(this.resetPadding,20)},!1),n.resetPadding=function(){this.style["padding-right"]="0px",this.timeout=null},n.resetPadding=n.resetPadding.bind(n)),n.show=function(){this.style.display="block",bb.refresh()},n.show=n.show.bind(n),n.hide=function(){this.style.display="none",bb.refresh()},n.hide=n.hide.bind(n),n.remove=function(){this.parentNode.removeChild(this),bb.refresh()},n.remove=n.remove.bind(n),n.refresh=function(){this.scroller&&this.scroller.refresh()},n.refresh=n.refresh.bind(n),setTimeout(n.refresh,0),n.scrollTo=function(t,e){this.scroller?this.scroller.scrollTo(t,e):this.scrollTop=t},n.scrollTo=n.scrollTo.bind(n),n.scrollToElement=function(t){if(this.scroller)this.scroller.scrollToElement(t);else{if(!t)return;var e=0,i=t;if(i.offsetParent)do e+=i.offsetTop;while(i=i.offsetParent);this.scrollTo(e,0)}},n.scrollToElement=n.scrollToElement.bind(n),n.setAttribute("class","bb-scroll-panel")}}},_PlayBook_contextMenu={create:function(t){var e=300;bb.device.is1024x600?e=100:bb.device.is720x720&&(e=300);var i,n=document.createElement("div"),o=document.createElement("div"),r=document.createElement("div");return n.setAttribute("class","bb-context-menu bb-context-menu-dark"),n.actions=[],n.hideEvents=[],n.threshold=e,n.visible=!1,n.overlay=document.createElement("div"),n.overlay.threshold=e,n.overlay.setAttribute("class","bb-context-menu-overlay"),n.overlay.menu=n,t.appendChild(n.overlay),n.overlay.ontouchmove=function(t){if(this.menu.peeking){var e=t.touches[0];this.startPos&&this.startPos-e.pageX>this.threshold&&(this.menu.show(this.menu.selected),this.closeMenu=!1)}},n.overlay.ontouchend=function(){this.closeMenu&&(this.menu.hide(),event.preventDefault())},n.overlay.ontouchstart=function(t){if(this.closeMenu=!0,!this.menu.peeking&&this.menu.visible)t.preventDefault();else if(!this.menu.peeking)return;var e=t.touches[0];this.startPos=e.pageX,t.preventDefault()},i=document.createElement("div"),i.setAttribute("class","bb-context-menu-item bb-context-menu-header-dark"),n.header=i,n.appendChild(i),o.setAttribute("class","bb-context-menu-header-title bb-context-menu-header-title-dark"),o.style.width=_PlayBook_contextMenu.getWidth()-20+"px",n.topTitle=o,i.appendChild(o),r.setAttribute("class","bb-context-menu-header-description"),r.style.width=_PlayBook_contextMenu.getWidth()-20+"px",n.description=r,i.appendChild(r),n.scrollContainer=document.createElement("div"),n.scrollContainer.setAttribute("class","bb-context-menu-scroller"),n.appendChild(n.scrollContainer),n.style.left=_PlayBook_contextMenu.getLeft(),n.show=function(t){t?(this.header.style.display="",this.header.style.visibility="",t.title&&(this.topTitle.innerHTML=t.title),t.description&&(this.description.innerHTML=t.description),this.selected=t,n.scrollContainer.style.top=bb.device.isPlayBook?"64px":"130px"):(this.header.style.display="none",this.selected=void 0,n.scrollContainer.style.top="0px"),n.scrollContainer.style["overflow-y"]="scroll",n.scrollContainer.style["overflow-x"]="hidden",n.scrollContainer.style["-webkit-overflow-scrolling"]="-blackberry-touch",this.peeking=!1,this.overlay.style.display="inline",this.style["-webkit-transition"]="all 0.3s ease-in-out",this.style["-webkit-transform"]="translate(-"+_PlayBook_contextMenu.getWidth()+"px, 0)",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]="1000",this.addEventListener("touchstart",this.touchHandler,!1),this.onclick=function(){this.hide()},this.header.addEventListener("click",this.hide,!1),this.style.visibility="visible",this.visible=!0,bb.device.isPlayBook?blackberry.app.event.onSwipeDown(""):blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar)},n.show=n.show.bind(n),n.hide=function(){this.overlay.style.display="none",this.removeEventListener("touchstart",this.touchHandler,!1),this.removeEventListener("touchmove",this.touchMoveHandler,!1),this.style["-webkit-transition"]="all 0.5s ease-in-out",this.style["-webkit-transform"]="translate("+_PlayBook_contextMenu.getWidth()+"px, 0px)",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]="1000",this.peeking||this.header.removeEventListener("click",this.hide,!1),this.peeking=!1,this.visible=!1,n.scrollContainer.style["overflow-y"]="",n.scrollContainer.style["overflow-x"]="",n.scrollContainer.style["-webkit-overflow-scrolling"]="";for(var t=n.hideEvents.length-1;t>=0;t--)n.hideEvents[t](),n.hideEvents.pop();if(bb.device.isPlayBook)for(var t=0;this.actions.length>t;t++)this.actions[t].ontouchend();bb.device.isPlayBook?blackberry.app.event.onSwipeDown(bb.menuBar.showMenuBar):blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)},n.hide=n.hide.bind(n),n.peek=function(t){t?(this.header.style.display="",t.title&&(this.topTitle.innerHTML=t.title),t.description&&(this.description.innerHTML=t.description),this.selected=t,n.scrollContainer.style.top=bb.device.isPlayBook?"64px":"130px"):n.scrollContainer.style.top="0px",this.header.style.visibility="hidden",this.header.style["margin-bottom"]="-"+Math.floor(this.header.offsetHeight/2)+"px",this.peeking=!0,this.overlay.style.display="inline",this.style["-webkit-transition"]="all 0.3s ease-in-out",this.style["-webkit-transform"]="translate(-"+_PlayBook_contextMenu.getPeekWidth()+", 0)",this.style["-webkit-backface-visibility"]="hidden",this.style["-webkit-perspective"]="1000",this.addEventListener("touchstart",this.touchHandler,!1),this.addEventListener("touchmove",this.touchMoveHandler,!1),this.onclick=function(t){(t.target==this||t.target==this.scrollContainer)&&this.show(this.selected)},this.header.removeEventListener("click",this.hide,!1),this.style.visibility="visible",this.visible=!0,bb.device.isPlayBook?blackberry.app.event.onSwipeDown(""):blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar)},n.peek=n.peek.bind(n),n.clearWWcontextMenu=function(){},n.clearWWcontextMenu=n.clearWWcontextMenu.bind(n),n.touchHandler=function(t){if(this.peeking){var e=t.touches[0];this.startPos=e.pageX,t.target==this.scrollContainer||t.target.parentNode==this.scrollContainer&&t.target!=this.header&&(t.preventDefault(),t.stopPropagation())}},n.touchHandler=n.touchHandler.bind(n),n.touchMoveHandler=function(t){if(this.peeking){var e=t.touches[0];this.startPos&&this.startPos-e.pageX>this.threshold&&this.show(this.selected)}},n.touchMoveHandler=n.touchMoveHandler.bind(n),n.onclick=function(t){this.peeking&&(this.show(this.selected),t.stopPropagation())},n.centerMenuItems=function(){var t,e,i,n=bb.innerHeight(),o=111,r=0,s=0,a=!0;for(bb.device.isPlayBook?o=53:bb.device.is720x720?o=80:bb.device.is1280x720?o=91:bb.device.is1440x1440&&(o=132),s=void 0==this.actionBar?o:0,e=0;this.actions.length>e;e++)i=this.actions[e],1==i.visible&&(r++,a&&this.pinnedAction!=i?(a=!1,i.setAttribute("class",i.normal+" bb-context-menu-item-first-dark"),i.isFirst=!0):this.pinnedAction!=i&&i.setAttribute("class",i.normal));r=this.pinnedAction?r-1:r,t=n-Math.floor(n/2)-Math.floor(r*o/2)-s,0>t&&(t=0),this.scrollContainer.style["padding-top"]=t+"px"},n.centerMenuItems=n.centerMenuItems.bind(n),n.orientationChanged=function(){this.style["-webkit-transition"]="",this.style.left=bb.innerWidth()+"px",this.style.height=bb.innerHeight()+"px",this.centerMenuItems()},n.orientationChanged=n.orientationChanged.bind(n),window.addEventListener("orientationchange",n.orientationChanged,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:n.orientationChanged}),n.addEventListener("webkitTransitionEnd",function(){this.visible||(this.style.visibility="hidden")}),n.add=function(t){var e,i,n=t.innerHTML,o=!1;e="bb-context-menu-item bb-context-menu-item-dark",t.hasAttribute("data-bb-visible")&&"false"==t.getAttribute("data-bb-visible").toLowerCase()?(t.visible=!1,t.style.display="none"):t.visible=!0,this.actions.push(t),o=t.hasAttribute("data-bb-pin")&&"true"==t.getAttribute("data-bb-pin").toLowerCase(),o&&!this.pinnedAction?(e+=" bb-context-menu-item-first-dark",t.style.bottom="-2px",t.style.position="absolute",t.style.width="100%",this.pinnedAction=t,this.appendChild(t),this.scrollContainer.style.bottom=bb.device.isPlayBook?"64px":bb.device.is720x720?"95px":"130px"):this.scrollContainer.appendChild(t),i=e+" bb-context-menu-item-hover",t.normal=e,t.highlight=i,t.innerHTML="";var r=document.createElement("div"),s=document.createElement("img");s.setAttribute("src",t.getAttribute("data-bb-img")),s.setAttribute("class","bb-context-menu-item-image"),t.img=s,t.appendChild(s),r.setAttribute("class","bb-context-menu-item-inner"),t.appendChild(r),r.innerHTML=n,t.display=r,t.menu=this,t.setAttribute("class",e),t.ontouchstart=function(t){if(this.menu.peeking?this.style["border-left-color"]=bb.options.highlightColor:this.style["background-color"]=bb.options.highlightColor,t.stopPropagation(),bb.device.isPlayBook){var e,i;for(i=0;this.menu.actions.length>i;i++)e=this.menu.actions[i],e!=this&&e.ontouchend()}},t.ontouchend=function(){this.menu.peeking?this.style["border-left-color"]="transparent":this.style["background-color"]=""},t.addEventListener("click",this.hide,!1),t.setCaption=function(t){this.display.innerHTML=t},t.setCaption=t.setCaption.bind(t),t.setImage=function(t){this.img.setAttribute("src",t)},t.setImage=t.setImage.bind(t),t.hide=function(){this.visible&&(this.visible=!1,this.style.display="none",this.menu.centerMenuItems())},t.hide=t.hide.bind(t),t.show=function(){this.visible||(this.visible=!0,this.style.display="",this.menu.centerMenuItems())},t.show=t.show.bind(t)},n.add=n.add.bind(n),n},getWidth:function(){return bb.device.isPlayBook?"300":bb.device.is1280x720?"435":bb.device.is1440x1440?"654":bb.device.is720x720?"490":"563"},getPeekWidth:function(){return bb.device.isPlayBook?"55px":"121px"},getLeft:function(){return window.innerWidth+3+"px"}};