This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
/
bbui-min.js
7 lines (7 loc) · 215 KB
/
bbui-min.js
1
2
3
4
5
6
7
/*! bbUI VERSION: 0.9.6.129 | 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(e){if(e)for(var t in e)bb.options[t]=e[t];window.blackberry&&blackberry.system&&blackberry.system.event&&blackberry.system.event.onHardwareKey&&(bb.options.onbackkey?blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,bb.options.onbackkey):blackberry.system.event.onHardwareKey(blackberry.system.event.KEY_BACK,bb.popScreen)),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=bb.device.isPlayBook&&bb.options.bb10ForPlayBook?!0:navigator.userAgent.indexOf("BB10")>=0,bb.device.isBB7=navigator.userAgent.indexOf("7.0.0")>=0||navigator.userAgent.indexOf("7.1.0")>=0,bb.device.isBB6=navigator.userAgent.indexOf("6.0.0")>=0,bb.device.isBB5=navigator.userAgent.indexOf("5.0.0")>=0,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.isHiRes=bb.device.isRipple?window.innerHeight>480||window.innerWidth>480:screen.width>480||screen.height>480;var t,i=document.head.querySelectorAll("meta[name=viewport]");for(t=0;i.length>t;t++)try{document.head.removeChild(i[t])}catch(n){}var o=document.createElement("meta");o.setAttribute("name","viewport"),bb.device.isBB10&&!bb.device.is1024x600?o.setAttribute("content","initial-scale="+1/window.devicePixelRatio+",user-scalable=no"):o.setAttribute("content","initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi"),document.head.appendChild(o);var r=parseInt(bb.cutHex(bb.options.highlightColor).substring(0,2),16),s=parseInt(bb.cutHex(bb.options.highlightColor).substring(2,4),16),l=parseInt(bb.cutHex(bb.options.highlightColor).substring(4,6),16);if(bb.options.shades={R:r,G:s,B:l,darkHighlight:"rgb("+(r-120)+", "+(s-120)+", "+(l-120)+")",mediumHighlight:"rgb("+(r-60)+", "+(s-60)+", "+(l-60)+")",darkOutline:"rgb("+(r-32)+", "+(s-32)+", "+(l-32)+")",darkDarkHighlight:"rgb("+(r-140)+", "+(s-140)+", "+(l-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;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)}catch(n){console.log(n.message)}bb.screen.controlColor=bb.options.controlsDark?"dark":"light",bb.screen.listColor=bb.options.listsDark?"dark":"light",bb.device.isBB10?(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.isBB5?(bb.imageList=_bb_5_6_7_imageList,bb.button=_bb5_button,bb.bbmBubble=_bb_bbmBubble,bb.roundPanel=_bb_5_6_7_roundPanel,bb.pillButtons=_bb5_pillButtons,bb.labelControlContainers=_bb5_labelControlContainers,bb.progress=_bb_progress):bb.device.isPlayBook?(bb.imageList=_bbPlayBook_imageList,bb.button=_bbPlayBook_button,bb.bbmBubble=_bb_bbmBubble,bb.dropdown=_bb_6_7_PlayBook_dropdown,bb.textInput=_bbPlayBook_textInput,bb.pillButtons=_bb_6_7_PlayBook_pillButtons,bb.labelControlContainers=_bb_6_7_PlayBook_labelControlContainers,bb.progress=_bb_progress,bb.scrollPanel=_bb_PlayBook_10_scrollPanel,bb.roundPanel=_bbPlayBook_roundPanel,bb.activityIndicator=_bbPlayBook_activityIndicator):(bb.imageList=_bb_5_6_7_imageList,bb.button=_bb_6_7_button,bb.bbmBubble=_bb_bbmBubble,bb.dropdown=_bb_6_7_PlayBook_dropdown,bb.textInput=_bb_6_7_textInput,bb.pillButtons=_bb_6_7_PlayBook_pillButtons,bb.labelControlContainers=_bb_6_7_PlayBook_labelControlContainers,bb.progress=_bb_progress,bb.roundPanel=_bb_5_6_7_roundPanel),!bb.device.isBB10||bb.device.isPlayBook||bb.device.isRipple||bb.device.is720x720||(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.isBB10||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(e){var t=e||document.body;bb.screen.apply(t.querySelectorAll("[data-bb-type=screen]")),bb.style(t),bb.screen.reAdjustHeight()},style:function(e){bb.scrollPanel&&bb.scrollPanel.apply(e.querySelectorAll("[data-bb-type=scroll-panel]")),bb.textInput&&bb.textInput.apply(e.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(e.querySelectorAll("select")),bb.roundPanel&&bb.roundPanel.apply(e.querySelectorAll("[data-bb-type=round-panel]")),bb.imageList&&bb.imageList.apply(e.querySelectorAll("[data-bb-type=image-list]")),bb.grid&&bb.grid.apply(e.querySelectorAll("[data-bb-type=grid-layout]")),bb.bbmBubble&&bb.bbmBubble.apply(e.querySelectorAll("[data-bb-type=bbm-bubble]")),bb.pillButtons&&bb.pillButtons.apply(e.querySelectorAll("[data-bb-type=pill-buttons]")),bb.labelControlContainers&&bb.labelControlContainers.apply(e.querySelectorAll("[data-bb-type=label-control-container]")),bb.button&&bb.button.apply(e.querySelectorAll("[data-bb-type=button]")),bb.fileInput&&bb.fileInput.apply(e.querySelectorAll("input[type=file]")),bb.slider&&bb.slider.apply(e.querySelectorAll("input[type=range]")),bb.progress&&bb.progress.apply(e.querySelectorAll("progress")),bb.radio&&bb.radio.apply(e.querySelectorAll("input[type=radio]")),bb.activityIndicator&&bb.activityIndicator.apply(e.querySelectorAll("[data-bb-type=activity-indicator]")),bb.checkbox&&bb.checkbox.apply(e.querySelectorAll("input[type=checkbox]")),bb.toggle&&bb.toggle.apply(e.querySelectorAll("[data-bb-type=toggle]"))},getCurScreen:function(){return document.querySelector("[data-bb-type=screen]")},device:{isHiRes:!1,isBB5:!1,isBB6:!1,isBB7:!1,isBB10:!1,isPlayBook:!1,isRipple:!1,is1024x600:!1,is1280x768:!1,is720x720:!1,is1280x720:!1},options:{onbackkey:null,onscreenready:null,ondomready:null,controlsDark:!1,coloredTitleBar:!1,listsDark:!1,highlightColor:"#00A8DF",bb10ForPlayBook:!1},loadScreen:function(url,id,popping,guid,params,screenRecord){var xhr=new XMLHttpRequest,container=document.createElement("div"),_reduce=function(e,t,i){var n=i;return Array.prototype.forEach.apply(e,[function(e){n=t(n,e)}]),n},whereScript=function(e,t){return"SCRIPT"===t.nodeName&&e.push(t),_reduce(t.childNodes,whereScript,e)},i,scripts=[],newScriptTags=[];xhr.open("GET",url,!1),xhr.send(),container.setAttribute("id",guid),container.innerHTML=xhr.responseText,scripts=_reduce(container.childNodes,whereScript,[]),container.scriptIds=[],screenRecord&&(screenRecord.scripts=[]),scripts.forEach(function(script){var scriptTag=document.createElement("script"),type=script.getAttribute("type");if(!type||"text/javascript"==type.toLowerCase()){if(script.text)return eval(script.text),void 0;var scriptGuid=bb.guidGenerator();screenRecord?screenRecord.scripts.push({id:scriptGuid,onunload:script.getAttribute("onunload")}):container.scriptIds.push({id:scriptGuid,onunload:script.getAttribute("onunload")}),scriptTag.setAttribute("type","text/javascript"),scriptTag.setAttribute("src",script.getAttribute("src")),scriptTag.setAttribute("id",scriptGuid),newScriptTags.push(scriptTag),script.parentNode.removeChild(script)}}),container.getElementById=function(e,t){var i=null;if(t||(t=this),t.getAttribute("id")==e)return t;for(var n=0;t.childNodes.length>n;n++){var o=t.childNodes[n];if(1==o.nodeType&&(i=this.getElementById(e,o)))break}return i},bb.screen.scriptCounter=0,bb.screen.totalScripts=newScriptTags.length;for(var i=0;newScriptTags.length>i;i++)document.body.appendChild(newScriptTags[i]),newScriptTags[i].onload=function(){bb.screen.scriptCounter++,bb.screen.scriptCounter==bb.screen.totalScripts&&bb.initContainer(container,id,popping,params)};return 0===bb.screen.totalScripts&&setTimeout(function(){bb.initContainer(container,id,popping,params)},0),container},initContainer:function(e,t,i,n){bb.options.onscreenready&&bb.options.onscreenready(e,t,n),bb.doLoad(e),document.body.appendChild(e);var o,r,s,l=e.querySelectorAll("[data-bb-type=screen]"),a=null;if(l.length>0){if(l=l[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&&(l.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=l;if(o.popping=i,o.hasAttribute("data-bb-effect")&&!bb.device.isBB5&&!bb.device.isBB6&&(r=o.getAttribute("data-bb-effect"))){if(r=r.toLowerCase(),"fade"==r)a=bb.screen.fadeIn;else if("fade-out"==r)a=bb.screen.fadeOut;else if(!bb.device.isBB7)switch(r){case"slide-left":a=bb.screen.slideLeft;break;case"slide-out-left":a=bb.screen.slideOutLeft;break;case"slide-right":a=bb.screen.slideRight;break;case"slide-out-right":a=bb.screen.slideOutRight;break;case"slide-up":a=bb.screen.slideUp;break;case"slide-out-up":a=bb.screen.slideOutUp;break;case"slide-down":a=bb.screen.slideDown;break;case"slide-out-down":a=bb.screen.slideOutDown}o.style.display="inline",a&&(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 t=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(),l.style["z-index"]="",bb.screens[bb.screens.length-1].container=e):(bb.removePreviousScreenFromDom(),t.left="",t.right="",t.top="",t.bottom="",t.width="",t.height="",t["-webkit-animation-name"]="",t["-webkit-animation-duration"]="",t["-webkit-animation-timing-function"]="",t["-webkit-transform"]=""):1>=bb.screens.length&&(t.left="",t.right="",t.top="",t.bottom="",t.width="",t.height="",t["-webkit-animation-name"]="",t["-webkit-animation-duration"]="",t["-webkit-animation-timing-function"]="",t["-webkit-transform"]=""),this.removeEventListener("webkitAnimationEnd",this.doEndAnimation),bb.createScreenScroller(l)},o.doEndAnimation=o.doEndAnimation.bind(o),o.addEventListener("webkitAnimationEnd",o.doEndAnimation),a.call(this,o))}}if(bb.options.ondomready?(bb.domready.container=e,bb.domready.id=t,bb.domready.params=n,setTimeout(bb.domready.fire,1)):setTimeout(bb.domready.fireEventsOnly,1),!a){if(i){if(i){l.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=e}}else(bb.device.isBB5||bb.device.isBB6||bb.device.isBB7)&&bb.screens.length>0?bb.removePreviousScreenFromDom():bb.screens.length>1&&bb.removePreviousScreenFromDom();bb.createScreenScroller(l)}},domready:{container:null,id:null,params:null,fire:function(){if(bb.screen.animating)return setTimeout(bb.domready.fire,250),void 0;var e=document.createEvent("Events");e.initEvent("bbuidomready",!0,!0),document.dispatchEvent(e),e=document.createEvent("Events"),e.initEvent("bbuilistready",!0,!0),document.dispatchEvent(e),bb.options.ondomready(bb.domready.container,bb.domready.id,bb.domready.params),bb.domready.container=null,bb.domready.id=null,bb.domready.params=null,e=document.createEvent("Events"),e.initEvent("bbuidomprocessed",!0,!0),document.dispatchEvent(e)},fireEventsOnly:function(){if(bb.screen.animating)return setTimeout(bb.domready.fireEventsOnly,250),void 0;var e=document.createEvent("Events");e.initEvent("bbuidomready",!0,!0),document.dispatchEvent(e),e=document.createEvent("Events"),e.initEvent("bbuilistready",!0,!0),document.dispatchEvent(e),e=document.createEvent("Events"),e.initEvent("bbuidomprocessed",!0,!0),document.dispatchEvent(e)}},createScreenScroller:function(e){var t=e.bbUIscrollWrapper;if(t)if(bb.device.isPlayBook){var i={hideScrollbar:!0,fadeScrollbar:!0,onBeforeScrollStart:function(e){var t=e.target;if(!t.parentNode||"bb-bb10-dropdown-items"!=t.parentNode.getAttribute("class")){for(;1!=t.nodeType;)t=t.parentNode;if("SELECT"!=t.tagName&&"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"AUDIO"!=t.tagName&&"VIDEO"!=t.tagName){e.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(t){e.onscroll&&e.onscroll(t),evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)}};bb.scroller=new iScroll(t,i)}else bb.device.isBB10&&(bb.scroller=null,t.style["-webkit-overflow-scrolling"]="-blackberry-touch",t.onscroll=function(t){e.onscroll&&e.onscroll(t)})},clearScrollers:function(){for(var e,t=bb.dropdownScrollers-1;t>-1;t--)e=bb.dropdownScrollers[t],e.destroy(),e=null,bb.dropdownScrollers.pop()},removeTopMostScreenFromDom:function(){var e=bb.screens.length,t=document.getElementById(bb.screens[e-1].guid);document.body.removeChild(t)},removePreviousScreenFromDom:function(){var e,t,i=bb.screens.length;1!=i&&(t=i>1?2:1,e=document.getElementById(bb.screens[i-t].guid),e&&document.body.removeChild(e))},pushScreen:function(e,t,i){bb.removeLoadedScripts(),bb.menuBar.clearMenu();var n,o=bb.screens.length;o>0&&(bb.screen.overlay=null,bb.screen.tabOverlay=null,bb.clearScrollers(),bb.screen.contextMenu&&(bb.screen.contextMenu=null),(bb.device.isBB5||bb.device.isBB6||bb.device.isBB7)&&(n=document.getElementById(bb.screens[o-1].guid),n.style.display="none",window.scroll(0,0)));var r=bb.guidGenerator(),s=bb.loadScreen(e,t,!1,r,i);bb.screens.push({id:t,url:e,scripts:s.scriptIds,container:s,guid:r,params:i})},popScreen:function(){var e,t,i=bb.screens.length;if(i>1){for(bb.removeLoadedScripts(),bb.clearScrollers(),bb.menuBar.clearMenu(),bb.screen.overlay=null,bb.screen.tabOverlay=null,e=0;bb.windowListeners.length>e;e++)t=bb.windowListeners[e],window.removeEventListener(t.name,t.eventHandler,!1);for(bb.windowListners=[],e=0;bb.documentListeners.length>e;e++)t=bb.documentListeners[e],document.removeEventListener(t.name,t.eventHandler,!1);bb.documentListeners=[];var n=bb.screens[i-2];bb.loadScreen(n.url,n.id,!0,n.guid,n.params,n),(bb.device.isBB5||bb.device.isBB6||bb.device.isBB7)&&window.scroll(0,0)}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(e){return"#"==e.charAt(0)?e.substring(1,7):e},guidGenerator:function(){var e=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+e()+e()+e()+e()+e()+e()},refresh:function(){bb.scroller&&bb.scroller.refresh()},isScrolledIntoView:function(e){var t=0,i=e;if(i.offsetParent)do t+=i.offsetTop,i.scrollTop&&(t-=i.scrollTop),bb.device.isPlayBook&&(i.scroller?t+=i.scroller.y:i.bbUIscrollWrapper&&(t+=bb.scroller.y));while(i=i.offsetParent);return bb.innerHeight()>t}},Function.prototype.bind=function(e){var t=this;return function(){return t.apply(e,arguments)}},_bb10_activityIndicator={apply:function(e){var t,i,n,o,r,s,l,a=bb.screen.controlColor,b="1280x768-1280x720";if(bb.device.is1024x600?b="1024x600":bb.device.is1280x768||bb.device.is1280x720?b="1280x768-1280x720":bb.device.is720x720&&(b="720x720"),e.length>0){var d,c,h=document.createElement("canvas");h.setAttribute("height","184px"),h.setAttribute("width","184px"),d=h.getContext("2d"),d.beginPath(),d.moveTo(92,154),d.arcTo(154,154,154,92,62),d.arcTo(154,30,92,30,62),d.arcTo(81,30,81,20,10),d.arcTo(81,10,91,10,10),d.arcTo(173,10,173,92,82),d.arcTo(173,173,92,173,82),d.arcTo(81,173,81,164,10),d.arcTo(81,154,92,154,10),d.closePath(),d.strokeStyle="transparent",d.stroke();var c=d.createLinearGradient(0,50,0,154);c.addColorStop(0,"transparent"),c.addColorStop(1,bb.options.highlightColor),d.fillStyle=c,d.fill(),l=h.toDataURL()}for(t=0;e.length>t;t++)i=e[t],r=i.hasAttribute("data-bb-size")?i.getAttribute("data-bb-size").toLowerCase():"medium","large"==r?s=bb.device.is1024x600?"93px":bb.device.is1280x768||bb.device.is1280x720?"184px":bb.device.is720x720?"170px":"184px":"small"==r?s=bb.device.is1024x600?"21px":bb.device.is1280x768||bb.device.is1280x720?"41px":"41px":(r="medium",s=bb.device.is1024x600?"46px":bb.device.is1280x768||bb.device.is1280x720?"93px":bb.device.is720x720?"88px":"93px"),i.style.width=s,o=document.createElement("div"),o.setAttribute("class","bb-bb10-activity-margin-"+b+" bb-bb10-activity-"+r+"-"+b+" bb-activity-"+a),i.appendChild(o),n=document.createElement("div"),n.setAttribute("class","bb-bb10-activity-"+r+"-"+b),n.style["background-image"]='url("'+l+'")',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(e){for(var t=0;e.length>t;t++)bb.button.style(e[t])},style:function(e){var t="1280x768-1280x720";bb.device.is1024x600?t="1024x600":bb.device.is1280x768||bb.device.is1280x720?t="1280x768-1280x720":bb.device.is720x720&&(t="720x720");var i,n,o,r,s=document.createElement("div"),l=document.createElement("div");if(disabled=e.hasAttribute("data-bb-disabled"),normal="bb-bb10-button bb-bb10-button-"+t,highlight="bb-bb10-button bb-bb10-button-"+t+" bb10-button-highlight",outerNormal="bb-bb10-button-container-"+t+" bb-bb10-button-container-"+bb.screen.controlColor,outerNormalWithoutImageOnly=outerNormal,e.isImageOnly=!1,e.enabled=!disabled,o=e.innerHTML,s.innerHTML=o,e.innerHTML="",e.stretched=!1,e.captionElement=s,e.appendChild(l),e.innerElement=l,e.hasAttribute("data-bb-style")){var a=e.getAttribute("data-bb-style");"stretch"==a&&(outerNormal+=" bb-bb10-button-stretch",e.stretched=!0)}return n=e.hasAttribute("data-bb-img")?e.getAttribute("data-bb-img"):void 0,n&&(o&&0!=o.length?(s.setAttribute("class","bb-bb10-button-caption-with-image-"+t),r=document.createElement("div"),e.imgElement=r,r.setAttribute("class","bb-bb10-button-image-"+t),r.style["background-image"]='url("'+n+'")',l.appendChild(r)):(outerNormal=outerNormal+" bb-bb10-button-container-image-only-"+t,s.style["background-image"]='url("'+n+'")',e.style["line-height"]="0px",s.setAttribute("class","bb-bb10-button-caption-with-image-only-"+t),e.isImageOnly=!0)),l.appendChild(s),i=normal+" bb-bb10-button-disabled-"+bb.screen.controlColor,normal=normal+" bb-bb10-button-"+bb.screen.controlColor,disabled?(e.removeAttribute("data-bb-disabled"),l.setAttribute("class",i)):l.setAttribute("class",normal),e.setAttribute("class",outerNormal),e.outerNormal=outerNormal,e.outerNormalWithoutImageOnly=outerNormalWithoutImageOnly,e.innerElement=l,l.normal=normal,l.highlight=highlight,l.disabledStyle=i,disabled||(e.ontouchstart=function(){this.innerElement.setAttribute("class",this.innerElement.highlight)},e.ontouchend=function(){this.innerElement.setAttribute("class",this.innerElement.normal)}),e.trappedClick=e.onclick,e.onclick=void 0,null!==e.trappedClick&&e.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1),e.setCaption=function(e){if(this.isImageOnly&&e.length>0){this.captionElement.setAttribute("class","bb-bb10-button-caption-with-image-"+t);var i=document.createElement("div");this.imgElement=i,i.setAttribute("class","bb-bb10-button-image-"+t),i.style["background-image"]=this.captionElement.style["background-image"],this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(i),this.innerElement.appendChild(this.captionElement),this.setAttribute("class",this.outerNormalWithoutImageOnly),this.captionElement.style["background-image"]="",this.isImageOnly=!1}else 0==e.length&&this.imgElement&&(this.captionElement.setAttribute("class","bb-bb10-button-caption-with-image-only-"+t),this.setAttribute("class",this.outerNormalWithoutImageOnly+" bb-bb10-button-container-image-only-"+t),this.captionElement.style["background-image"]=this.imgElement.style["background-image"],this.isImageOnly=!0,this.innerElement.removeChild(this.imgElement),this.imgElement=null);this.captionElement.innerHTML=e},e.getCaption=function(){return this.captionElement.innerHTML},e.getCaption=e.getCaption.bind(e),e.setImage=function(e){if(this.isImageOnly)this.captionElement.style["background-image"]='url("'+e+'")';else if(this.imgElement&&e.length>0)this.imgElement.style["background-image"]='url("'+e+'")';else if(e.length>0){this.captionElement.setAttribute("class","bb-bb10-button-caption-with-image-"+t);var i=document.createElement("div");this.imgElement=i,i.setAttribute("class","bb-bb10-button-image-"+t),i.style["background-image"]='url("'+e+'")',this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(i),this.innerElement.appendChild(this.captionElement)}else this.imgElement&&0==e.length&&(this.innerElement.removeChild(this.imgElement),this.imgElement=null,this.captionElement.setAttribute("class",""))},e.getImage=function(){return this.isImageOnly?this.captionElement.style["background-image"].slice(4,-1):this.imgElement?this.imgElement.style["background-image"].slice(4,-1):""},e.getImage=e.getImage.bind(e),e.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)},e.enable=e.enable.bind(e),e.disable=function(){this.enabled&&(this.innerElement.setAttribute("class",this.innerElement.disabledStyle),this.ontouchstart=null,this.ontouchend=null,this.enabled=!1)},e.disable=e.disable.bind(e),e.show=function(){this.style.display=this.stretched?"block":"inline-block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.parentNode.removeChild(this),bb.refresh()},e.remove=e.remove.bind(e),e}},_bb10_checkbox={apply:function(e){for(var t=0;e.length>t;t++)bb.checkbox.style(e[t])},style:function(e){var t,i,n,o,r="1280x768-1280x720",s=bb.screen.controlColor;return bb.device.is1024x600?r="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(r="1280x768-1280x720"),t=document.createElement("div"),t.setAttribute("class","bb-bb10-checkbox-target-"+r),e.parentNode&&e.parentNode.insertBefore(t,e),e.style.display="none",t.appendChild(e),t.input=e,e.touchTarget=t,i=document.createElement("div"),i.setAttribute("class","bb-bb10-checkbox-outer-"+r+" bb-bb10-checkbox-outer-"+s),t.appendChild(i),n=document.createElement("div"),n.normal="bb-bb10-checkbox-inner-"+r+" bb-bb10-checkbox-inner-"+s,n.setAttribute("class",n.normal),i.appendChild(n),o=document.createElement("div"),o.hiddenClass="bb-bb10-checkbox-check-hidden-"+r+" bb-bb10-checkbox-check-image",o.displayClass="bb-bb10-checkbox-check-display-"+r+" bb-bb10-checkbox-check-image",o.setAttribute("class",o.hiddenClass),o.style["-webkit-transition-property"]="all",o.style["-webkit-transition-duration"]="0.1s",n.appendChild(o),t.checkElement=o,t.innerElement=n,t.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%)",t.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%)",t.ontouchstart=function(){this.input.checked||this.input.disabled||(this.innerElement.style.background=this.touchHighlight)},t.ontouchend=function(){this.input.checked||this.input.disabled||(this.innerElement.style.background="")},t.onclick=function(){if(!this.input.disabled){var e=document.createEvent("HTMLEvents");e.initEvent("change",!1,!0),this.input.checked=!this.input.checked,this.drawChecked(),this.input.dispatchEvent(e)}},t.drawChecked=function(){this.input.checked?(this.checkElement.setAttribute("class",this.checkElement.displayClass),this.innerElement.style["background-image"]=t.highlight):(this.checkElement.setAttribute("class",this.checkElement.hiddenClass),this.innerElement.style["background-image"]=""),this.input.disabled?(this.innerElement.parentNode.setAttribute("class","bb-bb10-checkbox-outer-"+r+" bb-bb10-checkbox-outer-disabled-"+s),this.innerElement.setAttribute("class","bb-bb10-checkbox-inner-"+r+" bb-bb10-checkbox-inner-disabled-"+s),this.innerElement.style.background="#c0c0c0"):(this.innerElement.parentNode.setAttribute("class","bb-bb10-checkbox-outer-"+r+" bb-bb10-checkbox-outer-"+s),this.innerElement.setAttribute("class","bb-bb10-checkbox-inner-"+r+" bb-bb10-checkbox-inner-"+s))},t.drawChecked=t.drawChecked.bind(t),e.setChecked=function(e){e!=this.checked&&(this.checked=e,this.touchTarget.drawChecked())},e.setChecked=e.setChecked.bind(e),e.getChecked=function(){return this.checked},e.getChecked=e.getChecked.bind(e),e.enable=function(){this.removeAttribute("disabled"),this.enabled=!0,this.touchTarget.drawChecked()},e.enable=e.enable.bind(e),e.disable=function(){this.enabled=!1,this.setAttribute("disabled","disabled"),this.touchTarget.drawChecked()},e.disable=e.disable.bind(e),e.show=function(){this.touchTarget.style.display="block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.touchTarget.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.touchTarget.parentNode.removeChild(this.touchTarget),bb.refresh()},e.remove=e.remove.bind(e),t.drawChecked(),t}},_bb10_contextMenu={actionIds:[],create:function(){var e=document.createElement("div");return e.style.display="none",e.actions=[],e.pinnedAction=void 0,e.oncontextmenu=function(e){this.centerMenuItems();for(var t,i=e.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=!0;break}i=i.parentNode}n&&(i.drawSelected(),t=i.getAttribute("data-webworks-context"),t=JSON.parse(t),this.selected={title:t.header,description:t.subheader,selected:i}),blackberry.event.removeEventListener("swipedown",bb.menuBar.showMenuBar)},e.oncontextmenu=e.oncontextmenu.bind(e),window.addEventListener("contextmenu",e.oncontextmenu),bb.windowListeners.push({name:"contextmenu",eventHandler:e.oncontextmenu}),e.oncontextmenuclosed=function(){this.selected&&this.selected.selected&&this.selected.selected.drawUnselected(),blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)
},e.oncontextmenuclosed=e.oncontextmenuclosed.bind(e),document.addEventListener("bbui.contextClosed",e.oncontextmenuclosed),bb.documentListeners.push({name:"bbui.contextClosed",eventHandler:e.oncontextmenuclosed}),e.add=function(e){this.actions.push(e),this.appendChild(e);var t={actionId:bb.guidGenerator(),label:e.innerHTML,icon:e.getAttribute("data-bb-img")};bb.contextMenu.actionIds.push(t.actionId),e.menuItem=t,e.menu=this,e.visible=e.hasAttribute("data-bb-visible")?"false"!=e.getAttribute("data-bb-visible").toLowerCase():!0,this.pinnedAction||e.hasAttribute("data-bb-pin")&&"true"==e.getAttribute("data-bb-pin").toLowerCase()&&(this.pinnedAction=e),e.doclick=function(t){var i,n=document.querySelectorAll("[data-bb-context-menu-id="+t+"]");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},e.onclick&&e.onclick())},e.doclick=e.doclick.bind(e),e.show=function(){this.visible||(this.visible=!0,this.removeAttribute("data-bb-visible"))},e.show=e.show.bind(e),e.hide=function(){this.visible&&(this.visible=!1,this.setAttribute("data-bb-visible","false"))},e.hide=e.hide.bind(e)},e.add=e.add.bind(e),e.centerMenuItems=function(){var e,t,i=[blackberry.ui.contextmenu.CONTEXT_ALL],n={includeContextItems:[blackberry.ui.contextmenu.CONTEXT_ALL],includePlatformItems:!1,includeMenuServiceItems:!1};for(this.pinnedAction&&(n.pinnedItemId=this.pinnedAction.menuItem.actionId),this.clearWWcontextMenu(),blackberry.ui.contextmenu.defineCustomContext("bbui-context",n),e=this.actions.length-1;e>=0;e--)t=this.actions[e],t.visible&&blackberry.ui.contextmenu.addItem(i,t.menuItem,t.doclick)},e.centerMenuItems=e.centerMenuItems.bind(e),e.clearWWcontextMenu=function(){var e,t=[blackberry.ui.contextmenu.CONTEXT_ALL];for(e=0;bb.contextMenu.actionIds.length>e;e++)blackberry.ui.contextmenu.removeItem(t,bb.contextMenu.actionIds[e])},e.centerMenuItems=e.centerMenuItems.bind(e),e.show=function(){},e.show=e.show.bind(e),e.peek=function(){},e.peek=e.peek.bind(e),e}},_bb10_dropdown={apply:function(e){for(i=0;e.length>i;i++)bb.dropdown.style(e[i])},style:function(e){var t="1280x768-1280x720";bb.device.is1024x600?t="1024x600":bb.device.is1280x768||bb.device.is1280x720?t="1280x768-1280x720":bb.device.is720x720&&(t="720x720");var i,n,o,r,s,l,a,b,d,c=!e.hasAttribute("disabled"),h="bb-bb10-dropdown bb-bb10-dropdown-"+t+" bb-bb10-dropdown-"+bb.screen.controlColor+" bb-bb10-dropdown-"+t,u="bb-bb10-dropdown bb-bb10-dropdown-"+t+" bb-bb10-dropdown-highlight-"+bb.screen.controlColor+" bb10Highlight bb-bb10-dropdown-"+t,p="bb-bb10-dropdown-container-"+t+" bb-bb10-dropdown-container-"+bb.screen.controlColor+" bb-bb10-dropdown-container-"+t,m="bb-bb10-dropdown-container-inner-"+t+" bb-bb10-dropdown-container-inner-"+bb.screen.controlColor,g="bb-bb10-dropdown-inner-"+t+" bb-bb10-dropdown-inner-"+bb.screen.controlColor;if(e.style.display="none",e.enabled=c,l=document.createElement("div"),l.select=e,l.items=[],l.setAttribute("data-bb-type","dropdown"),e.dropdown=l,e.parentNode&&e.parentNode.insertBefore(l,e),l.appendChild(e),r=document.createElement("div"),r.setAttribute("class",m),l.appendChild(r),e.hasAttribute("data-bb-style")){var v=e.getAttribute("data-bb-style");"stretch"==v&&(h+=" bb-bb10-dropdown-stretch",u+=" bb-bb10-dropdown-stretch")}s=document.createElement("div"),e.enabled?s.setAttribute("class",h):s.setAttribute("class",h+" bb-bb10-dropdown-disabled-"+bb.screen.controlColor),r.appendChild(s),o=document.createElement("div"),o.setAttribute("class",g),s.appendChild(o),a=document.createElement("div"),l.labelElement=a,a.setAttribute("class","bb-bb10-dropdown-label-"+t),e.hasAttribute("data-bb-label")&&(a.innerHTML=e.getAttribute("data-bb-label")),o.appendChild(a),i=document.createElement("div"),i.setAttribute("class","bb-bb10-dropdown-arrow-"+t+"-"+bb.screen.controlColor),o.appendChild(i),l.img=i,b=document.createElement("div"),l.captionElement=b,b.setAttribute("class","bb-bb10-dropdown-caption-"+t),o.appendChild(b);var y=document.createElement("div");y.style.position="relative",y.style["margin-top"]="10px",y.style.overflow="hidden",r.appendChild(y);var f=document.createElement("div");return y.appendChild(f),d=document.createElement("div"),l.itemsElement=d,d.setAttribute("class","bb-bb10-dropdown-items"),f.appendChild(d),l.refreshOptions=function(){var o,r,s,l,a,d,c=e.getElementsByTagName("option"),h="";for(this.itemsElement.innerHTML="",this.items=[],this.options=c,n=0;c.length>n;n++)o=c[n],r=document.createElement("div"),this.items.push(r),r.selectedStyle="bb-bb10-dropdown-item-"+t+" bb-bb10-dropdown-item-"+bb.screen.controlColor+" bb-bb10-dropdown-item-selected-"+bb.screen.controlColor,r.normalStyle="bb-bb10-dropdown-item-"+t+" bb-bb10-dropdown-item-"+bb.screen.controlColor,r.index=n,r.select=this.select,r.dropdown=this,r.dropdown.selected||(r.dropdown.selected=r),a=document.createElement("div"),a.setAttribute("class","primary-text"),a.innerHTML=o.innerHTML,s=document.createElement("div"),s.setAttribute("class","text-container"),s.appendChild(a),l=document.createElement("span"),l.setAttribute("class","text-align"),r.appendChild(l),r.appendChild(s),this.itemsElement.appendChild(r),o.hasAttribute("data-bb-accent-text")&&(d=document.createElement("div"),d.setAttribute("class","accent-text"),d.innerHTML=o.getAttribute("data-bb-accent-text"),r.accentText=d,s.appendChild(d)),i=document.createElement("div"),i.setAttribute("class","bb-bb10-dropdown-selected-image-"+t+"-"+bb.screen.controlColor),r.img=i,r.appendChild(i),o.hasAttribute("selected")||o.selected?(h=o.innerHTML,r.setAttribute("class",r.selectedStyle),i.style.visibility="visible",r.dropdown.selected=r):r.setAttribute("class",r.normalStyle),r.ontouchstart=function(){this.style["background-color"]=bb.options.highlightColor,this.style.color="white",this.accentText&&(this.accentText.style.color="white")},r.ontouchend=function(){this.style["background-color"]="transparent",this.style.color="",this.accentText&&(this.accentText.style.color="")},r.onclick=function(){this.select.setSelectedItem(this.index)};""==h&&c.length>0&&(h=c[0].innerHTML),""!=h&&(b.innerHTML=h)},l.refreshOptions=l.refreshOptions.bind(l),l.refreshOptions(),l.setAttribute("class",p),l.buttonOuter=s,l.isRefreshed=!1,l.caption=b,s.dropdown=l,l.open=!1,s.normal=h,s.highlight=u,l.scroller=new iScroll(y,{vScrollbar:!1,onBeforeScrollStart:function(e){bb.scroller&&bb.scroller.disable(),e.preventDefault()},onBeforeScrollEnd:function(){bb.scroller&&bb.scroller.enable()}}),bb.dropdownScrollers.push(l.scroller),l.scrollArea=y,s.dotouchstart=function(){this.setAttribute("class",this.highlight)},s.dotouchend=function(){this.setAttribute("class",this.normal)},s.doclick=function(){this.dropdown.open?this.dropdown.internalHide():this.dropdown.internalShow()},e.enabled&&(s.ontouchstart=s.dotouchstart,s.ontouchend=s.dotouchend,s.onclick=s.doclick),l.internalShow=function(){var e;this.open=!0,this.numItems=bb.device.is720x720&&this.options.length>4?3:this.options.length>5?5:this.options.length,bb.device.is1024x600?(e=43*this.numItems,this.style.height=45+e+"px"):bb.device.is1280x768||bb.device.is1280x720?(e=99*this.numItems,this.style.height=95+e+"px"):bb.device.is720x720?(e=85*this.numItems,this.style.height=77+e+"px"):(e=99*this.numItems,this.style.height=95+e+"px"),this.scrollArea.style.height=e-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",this.img.style["-webkit-transition"]="all 0.5s ease-in-out",this.img.style["-webkit-transform"]="rotate(-360deg)",bb.scroller&&bb.scroller.refresh(),this.scrollIntoView(!1)},l.internalShow=l.internalShow.bind(l),l.internalHide=function(){this.open=!1,this.style.height="59px",this.style.height=bb.device.is1024x600?"43px":bb.device.is1280x768||bb.device.is1280x720?"95px":bb.device.is720x720?"77px":"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,this.img.style.opacity="0.0",this.img.style["-webkit-transition"]="all 0.5s ease-in-out",this.img.style["-webkit-transform"]="rotate(0deg)",bb.scroller&&bb.scroller.refresh()},l.internalHide=l.internalHide.bind(l),e.setSelectedItem=function(e){if(this.selectedIndex!=e){var t=this.dropdown.items[e];if(!t)return;this.dropdown.selected&&(this.dropdown.selected.setAttribute("class",t.normalStyle),this.dropdown.selected.img.style.visibility="hidden"),t.setAttribute("class",t.selectedStyle),t.img.style.visibility="visible",this.dropdown.selected=t,this.selectedIndex=e,this.dropdown.caption.innerHTML=this.options[e].text,this.dropdown.internalHide(),window.setTimeout(this.fireEvent,0)}},e.setSelectedItem=e.setSelectedItem.bind(e),e.setSelectedText=function(e){for(var t=0;this.options.length>t;t++)if(this.options[t].text==e)return this.setSelectedItem(t),void 0},e.setSelectedText=e.setSelectedText.bind(e),e.fireEvent=function(){var e=document.createEvent("HTMLEvents");e.initEvent("change",!1,!0),this.dispatchEvent(e)},e.fireEvent=e.fireEvent.bind(e),e.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",h),this.removeAttribute("disabled"),this.enabled=!0)},e.enable=e.enable.bind(e),e.disable=function(){e.enabled&&(this.dropdown.internalHide(),this.dropdown.buttonOuter.ontouchstart=null,this.dropdown.buttonOuter.ontouchend=null,this.dropdown.buttonOuter.onclick=null,this.dropdown.buttonOuter.setAttribute("class",h+" bb-bb10-dropdown-disabled-"+bb.screen.controlColor),this.enabled=!1,this.setAttribute("disabled","disabled"))},e.disable=e.disable.bind(e),e.show=function(){this.dropdown.style.display="block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.dropdown.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.dropdown.parentNode.removeChild(this.dropdown),bb.refresh()},e.remove=e.remove.bind(e),e.refresh=function(){this.dropdown.internalHide(),this.dropdown.isRefreshed=!1,this.dropdown.refreshOptions()},e.refresh=e.refresh.bind(e),e.setCaption=function(e){this.dropdown.labelElement.innerHTML=e,this.setAttribute("data-bb-label",e)},e.setCaption=e.setCaption.bind(e),e.getCaption=function(){return this.dropdown.labelElement.innerHTML},e.getCaption=e.getCaption.bind(e),l}},_bb10_fileInput={apply:function(e){var t,i,n,o="1280x768-1280x720";for(bb.device.is1024x600?o="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(o="1280x768-1280x720"),t=0;e.length>t;t++)i=e[t],i.setAttribute("class","bb-bb10-file-button-"+o),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(e){var t,i="1280x768-1280x720",n=!1;bb.device.is1024x600?i="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(i="1280x768-1280x720");for(var o=0;e.length>o;o++){var r,s,l,a,b,d,c=e[o];for(c.setAttribute("class","bb-bb10-grid-"+i),c.isSquare=c.hasAttribute("data-bb-style")&&"square"==c.getAttribute("data-bb-style").toLowerCase(),n=c.hasAttribute("data-bb-header-style")?"solid"==c.getAttribute("data-bb-header-style").toLowerCase():!1,t=c.hasAttribute("data-bb-header-justify")?c.getAttribute("data-bb-header-justify").toLowerCase():"center",c.hasAttribute("data-bb-context")&&"true"==c.getAttribute("data-bb-context").toLowerCase()&&(d=bb.screen.contextMenu),s=c.querySelectorAll("[data-bb-type=group], [data-bb-type=row]"),r=0;s.length>r;r++)if(b=s[r],b.hasAttribute("data-bb-type"))if(l=b.getAttribute("data-bb-type").toLowerCase(),"group"==l&&b.hasAttribute("data-bb-title"))a=document.createElement("div"),a.normal="bb-bb10-grid-header-"+i,a.innerHTML="<p>"+b.getAttribute("data-bb-title")+"</p>",n?(a.normal=a.normal+" bb10Accent",a.style.color="white",a.style["border-bottom-color"]="transparent"):(a.normal=a.normal+" bb-bb10-grid-header-normal-"+bb.screen.listColor,a.style["border-bottom-color"]=bb.options.shades.darkOutline),a.normal="left"==t?a.normal+" bb-bb10-grid-header-left-"+i:"right"==t?a.normal+" bb-bb10-grid-header-right-"+i:a.normal+" bb-bb10-grid-header-center",a.setAttribute("class",a.normal),b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a);else if("row"==l){var h,u,p,m,g,v,y,f,w,y,E,x,k,C=0,A=-1,B=b.querySelectorAll("[data-bb-type=item]");if(g=B.length,0==g)continue;for(b.hasAttribute("data-bb-columns")&&(A=b.getAttribute("data-bb-columns")),u=document.createElement("table"),u.style.width="100%",b.appendChild(u),p=document.createElement("tr"),u.appendChild(p),A>0?B.length>A&&!bb.device.isPlayBook?(b.style["overflow-y"]="hidden",b.style["overflow-x"]="scroll",x=window.innerWidth/(parseInt(A)+.5)):x=window.innerWidth/A-6:x=window.innerWidth/g-6,h=0;g>h;h++)v=B[h],bb.device.isPlayBook&&A>0&&h>A-1?v.style.display="none":(y=v.innerHTML,a=v.getAttribute("data-bb-title"),k=y||a,v.innerHTML="",m=document.createElement("td"),p.appendChild(m),m.appendChild(v),C++,E=c.isSquare?x:Math.ceil(.5625*x),v.style.width=x+"px",v.style.height=E+"px",f=document.createElement("img"),f.style.height=E+"px",f.style.width=x+"px",f.style.opacity="0",f.style["-webkit-transition"]="opacity 0.5s linear",f.style["-webkit-transform"]="translate3d(0,0,0)",f.itemNode=v,v.image=f,v.appendChild(f),v.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)},v.onbbuidomready=v.onbbuidomready.bind(v),document.addEventListener("bbuidomready",v.onbbuidomready,!1),v.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 e=bb.documentListeners.indexOf(this.listener);e>=0&&bb.documentListeners.splice(e,1)}},v.onbbuiscrolling=v.onbbuiscrolling.bind(v),k?(w=document.createElement("div"),a&&y?(w.setAttribute("class","bb-bb10-grid-item-overlay-"+i+" bb-bb10-grid-item-overlay-two-rows-"+i),w.innerHTML='<div><p class="title title-two-rows">'+a+"<br/>"+y+"</p></div>"):a?(w.setAttribute("class","bb-bb10-grid-item-overlay-"+i+" bb-bb10-grid-item-overlay-one-row-"+i),w.innerHTML='<div><p class="title title-one-row">'+a+"</p></div>"):y&&(w.setAttribute("class","bb-bb10-grid-item-overlay-"+i+" bb-bb10-grid-item-overlay-one-row-"+i),w.innerHTML='<div><p class="title title-one-row">'+y+"</p></div>"),v.appendChild(w)):w=null,v.overlay=w,v.title=a,v.description=y,v.fingerDown=!1,v.contextShown=!1,v.contextMenu=d,v.contextMenu&&(v.guid="bbui"+bb.guidGenerator(),v.setAttribute("data-bb-context-menu-id",v.guid),v.setAttribute("data-webworks-context",'{"id":"'+v.guid+'","type":"bbui-context","header":"'+v.title+'","subheader":"'+v.description+'"}')),v.ontouchstart=function(){if(this.overlay&&(this.overlay.style.opacity="1.0",this.overlay.style["background-color"]=bb.options.highlightColor),v.fingerDown=!0,v.contextShown=!1,v.contextMenu&&(bb.device.isPlayBook||bb.device.isRipple)){window.setTimeout(this.touchTimer,667);var e=bb.getCurScreen();v.touchstartx=e.bbUIscrollWrapper.scrollTop}},v.ontouchend=function(){this.overlay&&(this.overlay.style.opacity="",this.overlay.style["background-color"]=""),v.fingerDown=!1,v.contextShown&&(event.preventDefault(),event.stopPropagation())},v.touchTimer=function(){if(bb.device.isPlayBook||bb.device.isRipple){var e=bb.getCurScreen(),t=e.bbUIscrollWrapper.scrollTop;v.fingerDown&&50>Math.abs(v.touchstartx-t)&&(v.contextShown=!0,v.contextMenu.peek({title:this.title,description:this.description,selected:this}))}},v.touchTimer=v.touchTimer.bind(v),v.drawSelected=function(){this.overlay&&(this.overlay.style.opacity="1.0",this.overlay.style["background-color"]=bb.options.highlightColor)},v.drawSelected=v.drawSelected.bind(v),v.drawUnselected=function(){this.overlay&&(this.overlay.style.opacity="",this.overlay.style["background-color"]="")},v.drawUnselected=v.drawUnselected.bind(v));if(A>0&&A>C){var S=A-C;for(b.extraColumns=[],h=0;S>h;h++)m=document.createElement("td"),p.appendChild(m),m.style.width=x+"px",b.extraColumns.push(m)}}c.orientationChanged=function(){var e,t,i,n,o,r,s,l,a=this.querySelectorAll("[data-bb-type=row]");for(e=0;a.length>e;e++){var b=-1;for(n=a[e],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,t=0;o>t;t++)r=i[t],l=c.isSquare?s:Math.ceil(.5625*s),r.image.style.height=l+"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=l+"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(t=0;n.extraColumns.length>t;t++)n.extraColumns[t].style.width=s+"px"}},c.orientationChanged=c.orientationChanged.bind(c),window.addEventListener("resize",c.orientationChanged,!1),bb.windowListeners.push({name:"resize",eventHandler:c.orientationChanged}),c.show=function(){this.style.display="block",bb.refresh()},c.show=c.show.bind(c),c.hide=function(){this.style.display="none",bb.refresh()},c.hide=c.hide.bind(c),c.remove=function(){this.parentNode.removeChild(this),bb.refresh()},c.remove=c.remove.bind(c)}}},_bb10_imageList={apply:function(elements){var res="1280x768-1280x720",i,j,outerElement,items;for(bb.device.is1024x600?res="1024x600":bb.device.is1280x768||bb.device.is1280x720?res="1280x768-1280x720":bb.device.is720x720&&(res="720x720"),i=0;elements.length>i;i++){outerElement=elements[i],outerElement.items=[],outerElement.setAttribute("class","bb-bb10-image-list"),outerElement.hideImages=outerElement.hasAttribute("data-bb-images")?"none"==outerElement.getAttribute("data-bb-images").toLowerCase():!1,outerElement.hideImages||(outerElement.imageEffect=outerElement.hasAttribute("data-bb-image-effect")?outerElement.getAttribute("data-bb-image-effect").toLowerCase():void 0,outerElement.imagePlaceholder=outerElement.hasAttribute("data-bb-image-placeholder")?outerElement.getAttribute("data-bb-image-placeholder"):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;"header"==type?(normal="bb-bb10-image-list-header bb-bb10-image-list-header-"+res,this.solidHeader?(normal+=" bb10Accent",innerChildNode.style.color="white",innerChildNode.style["border-bottom-color"]="transparent"):(normal=normal+" bb-bb10-image-list-header-normal-"+bb.screen.listColor,innerChildNode.style["border-bottom-color"]=bb.options.shades.darkOutline),"left"==this.headerJustify?normal=normal+" bb-bb10-image-list-header-left-"+res:"right"==this.headerJustify?normal=normal+" bb-bb10-image-list-header-right-"+res:normal+=" bb-bb10-image-list-header-center",innerChildNode.normal=normal,innerChildNode.innerHTML="<p>"+description+"</p>",innerChildNode.setAttribute("class",normal)):"item"==type&&(normal="bb-bb10-image-list-item bb-bb10-image-list-item-"+bb.screen.listColor+" bb-bb10-image-list-item-"+res,highlight=normal+" bb-bb10-image-list-item-hover bb10Highlight",innerChildNode.normal=normal,innerChildNode.highlight=highlight,innerChildNode.setAttribute("class",normal),innerChildNode.innerHTML="",this.hideImages||(img=document.createElement("img"),img.outerElement=this,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.appendChild(img),this.imageEffect?(img.style.opacity="0",img.style["-webkit-transition"]="opacity 0.5s linear",innerChildNode.imageList=this,innerChildNode.bbuilistready=function(){this.img.onload=function(){this.style.opacity="1.0"},this.img.src=this.img.path,this.imageList.imagePlaceholder&&(this.img.onerror=function(){this.src!=this.placeholder&&(this.src=this.placeholder)}),document.removeEventListener("bbuilistready",this.bbuilistready,!1)},innerChildNode.bbuilistready=innerChildNode.bbuilistready.bind(innerChildNode),document.addEventListener("bbuilistready",innerChildNode.bbuilistready,!1)):(img.src=img.path,this.imagePlaceholder&&(img.onerror=function(){this.src!=this.placeholder&&(this.src=this.placeholder,this.outerElement.imageEffect&&this.show())}))),details=document.createElement("div"),details.innerChildNode=innerChildNode,innerChildNode.details=details,innerChildNode.appendChild(details),detailsClass="bb-bb10-image-list-item-details-"+res,this.hideImages&&(detailsClass=detailsClass+" bb-bb10-image-list-item-noimage-"+res),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-bb10-image-list-description-"+bb.screen.listColor),details.description=descriptionDiv,details.appendChild(descriptionDiv),overlay=document.createElement("div"),overlay.setAttribute("class","bb-bb10-image-list-item-overlay-"+res),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-bb10-image-list-item-button-border-"+res+" bb-bb10-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-bb10-image-list-item-button-inner-"+res,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(e){e.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-bb10-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",bb.device.is1024x600?(title.style["margin-top"]="16px",overlay.style["margin-top"]="-72px"):bb.device.is1280x768||bb.device.is1280x720?(title.style["margin-top"]="-7px",overlay.style["margin-top"]="-121px"):bb.device.is720x720?(title.style["margin-top"]="-14px",overlay.style["margin-top"]="-108px"):(title.style["margin-top"]="-7px",overlay.style["margin-top"]="-121px"),accentText&&(accentText.style["margin-top"]=bb.device.is1024x600?"-52px":bb.device.is1280x768||bb.device.is1280x720?"-82px":bb.device.is720x720?"-82px":"-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,innerChildNode.contextMenu){window.setTimeout(this.touchTimer,667);var e=bb.getCurScreen();innerChildNode.touchstartx=e.bbUIscrollWrapper.scrollTop}}},innerChildNode.ontouchend=function(e){if(bb.device.isPlayBook){if(!innerChildNode.trappedClick&&!this.contextMenu)return;this.overlay.style["border-color"]="transparent",innerChildNode.fingerDown=!1,innerChildNode.contextShown&&(e.preventDefault(),e.stopPropagation())}},innerChildNode.touchTimer=function(){if(bb.device.isPlayBook){var e=bb.getCurScreen(),t=e.bbUIscrollWrapper.scrollTop;innerChildNode.fingerDown&&50>Math.abs(innerChildNode.touchstartx-t)&&(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.setAttribute("class",this.highlight),this.overlay.style["border-color"]=bb.options.shades.darkOutline},innerChildNode.drawSelected=innerChildNode.drawSelected.bind(innerChildNode),innerChildNode.drawUnselected=function(){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),innerChildNode.setAttribute("data-webworks-context",'{"id":"'+innerChildNode.guid+'","type":"bbui-context","header":"'+innerChildNode.title+'","subheader":"'+innerChildNode.description+'"}')),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.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 e=this.innerChildNode.parentNode,t=e.items.indexOf(this.innerChildNode);e.removeChild(this.innerChildNode),e.items.splice(t,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?this.img.getAttribute("src"):void 0},innerChildNode.getImage=innerChildNode.getImage.bind(innerChildNode))}},outerElement.styleItem=outerElement.styleItem.bind(outerElement),outerElement.appendItem=function(e){this.styleItem(e),this.appendChild(e),this.items.push(e);var t=document.createEvent("Events");t.initEvent("bbuilistready",!0,!0),document.dispatchEvent(t),bb.scroller&&bb.scroller.refresh()},outerElement.appendItem=outerElement.appendItem.bind(outerElement),outerElement.refresh=function(e){if(e&&e.length&&!(0>=e.length)){var t,i,n=document.createElement("div");for(this.items=[],t=0;e.length>t;t++)i=e[t],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)}},outerElement.refresh=outerElement.refresh.bind(outerElement),outerElement.insertItemBefore=function(e,t){this.styleItem(e),this.insertBefore(e,t),this.items.splice(this.items.indexOf(t),0,e);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 e,t=[];
for(e=0;this.items.length>e;e++)t.push(this.items[e]);return t},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(e){var t,i,n,o,r,s,l,a,b,d,c,h="1280x768-1280x720";for(bb.device.is1024x600?h="1024x600":bb.device.is1280x768||bb.device.is1280x720?h="1280x768-1280x720":bb.device.is720x720&&(h="720x720"),t=0;e.length>t;t++){if(i=e[t],n=i.querySelectorAll("[data-bb-type=row]"),n.length>0)for(o=document.createElement("table"),o.setAttribute("class","bb-bb10-label-control-rows"),i.insertBefore(o,n[0]),r=0;n.length>r;r++)s=n[r],l=document.createElement("tr"),l.setAttribute("class","bb-bb10-label-control-label-row-"+h),o.appendChild(l),a=document.createElement("td"),l.appendChild(a),b=s.querySelectorAll("[data-bb-type=label]")[0],b.setAttribute("class","bb-bb10-label-control-label-"+h),s.removeChild(b),a.appendChild(b),l=document.createElement("tr"),o.appendChild(l),d=document.createElement("td"),l.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(e){var t,i;for(t=0;e.length>t;t++)i=e[t],bb.pillButtons.style(i,!0)},style:function(e,t){var i="1280x768-1280x720";bb.device.is1024x600?i="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(i="1280x768-1280x720");var n,o,r,s,l,a,b,d="bb-bb10-pill-buttons-container-"+i+" bb-bb10-pill-buttons-container-"+bb.screen.controlColor,c="bb-bb10-pill-button-"+i,h=e.querySelectorAll("[data-bb-type=pill-button]"),u=Math.floor(100/h.length),p=10;for(e.sidePadding=p,e.setAttribute("class","bb-bb10-pill-buttons-"+i),n=document.createElement("div"),e.appendChild(n),n.setAttribute("class",d),e.selectedColor="dark"==bb.screen.controlColor?"#909090":"#555555",pill=document.createElement("div"),pillInner=document.createElement("div"),pill.appendChild(pillInner),pill.setAttribute("class",c+" bb-bb10-pill-button-selected-"+i+"-"+bb.screen.controlColor+" bb-bb10-pill-buttons-pill"),pillInner.setAttribute("class","bb-bb10-pill-button-inner-"+i+" bb-bb10-pill-button-inner-selected-"+i+"-"+bb.screen.controlColor),pill.style.opacity="0",e.pill=pill,n.appendChild(pill),e.style["padding-left"]=p+"px",e.style["padding-right"]=p+"px",s=document.createElement("table"),e.table=s,l=document.createElement("tr"),s.tr=l,s.appendChild(l),s.setAttribute("class","bb-bb10-pill-buttons-table"),s.style.opacity="0",n.appendChild(s),e.styleButton=function(t){return t.isSelected=!1,o=document.createElement("div"),o.innerHTML=t.innerHTML,t.innerHTML="",t.appendChild(o),t.border=o,t.outerElement=e,"true"==t.getAttribute("data-bb-selected")&&(t.isSelected=!0,e.selected=t,t.style.color=e.selectedColor),t.setAttribute("class",c),o.setAttribute("class","bb-bb10-pill-button-inner-"+i),t.style["z-index"]=4,t.style.width="100%",t.dotouchstart=function(){if(!this.isSelected){var e=this.outerElement.selected;e.style.color="","light"==bb.screen.controlColor&&(this.outerElement.pill.style["background-color"]="#DDDDDD"),this.outerElement.setPillLeft(this)}},t.dotouchstart=t.dotouchstart.bind(t),t.dotouchend=function(){if(!this.isSelected){var e=this.outerElement.selected;e.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"]="");var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0),t.doClick=!0,this.dispatchEvent(t)}},t.dotouchend=t.dotouchend.bind(t),bb.device.isRipple?(t.onmousedown=t.dotouchstart,t.onmouseup=t.dotouchend):(t.ontouchstart=t.dotouchstart,t.ontouchend=t.dotouchend),t.addEventListener("click",function(e){e.stopPropagation()},!0),t},e.styleButton=e.styleButton.bind(e),b=0;h.length>b;b++)r=h[b],r=e.styleButton(r),a=document.createElement("td"),l.appendChild(a),a.appendChild(r),a.style.width=u+"%";return e.recalculateSize=function(){var e,t=this.table.querySelectorAll("td"),i=parseInt(window.getComputedStyle(this).width)-this.sidePadding,n=Math.floor((i-4*t.length)/t.length)+"px";for(e=0;t.length>e;e++)t[e].style.width=n;this.table.style.width=i+"px",this.pill.style.width=n},e.recalculateSize=e.recalculateSize.bind(e),e.setPillLeft=function(e){if(!e&&(e=this.selected,!e)){var t=this.table.querySelectorAll("[data-bb-type=pill-button]");t.length>0&&(e=t[0],this.selected=e)}e&&(this.pill.style["-webkit-transform"]="translate3d("+e.parentNode.offsetLeft+"px,0px,0px)")},e.setPillLeft=e.setPillLeft.bind(e),e.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"},e.initialize=e.initialize.bind(e),t?(e.onbbuidomready=function(){this.initialize(),document.removeEventListener("bbuidomprocessed",this.onbbuidomready,!1)},e.onbbuidomready=e.onbbuidomready.bind(e),document.addEventListener("bbuidomprocessed",e.onbbuidomready,!1)):window.setTimeout(e.initialize,0),e.doOrientationChange=function(){this.recalculateSize(),this.setPillLeft()},e.doOrientationChange=e.doOrientationChange.bind(e),window.addEventListener("resize",e.doOrientationChange,!1),bb.windowListeners.push({name:"resize",eventHandler:e.doOrientationChange}),e.show=function(){this.style.display="block",this.recalculateSize(),this.setPillLeft(),bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.parentNode.removeChild(this),bb.refresh()},e.remove=e.remove.bind(e),e.clear=function(){var e,t=this.table.querySelectorAll("td");for(e=0;t.length>e;e++)this.table.tr.removeChild(t[e]);this.pill.style.opacity="0"},e.clear=e.clear.bind(e),e.appendButton=function(t){t=e.styleButton(t);var i=document.createElement("td");this.table.tr.appendChild(i),i.appendChild(t),this.initialize()},e.appendButton=e.appendButton.bind(e),e.getButtons=function(){for(var e=this.parentNode.querySelectorAll("[data-bb-type=pill-button]"),t=[],i=0;e.length>i;i++)t[i]=e[i].firstChild.innerHTML;return t},e.getButtons=e.getButtons.bind(e),e}},_bb10_radio={apply:function(e){for(var t=0;e.length>t;t++)bb.radio.style(e[t])},style:function(e){var e,t,i,n="1280x768-1280x720",o=bb.screen.controlColor,r=e;return bb.device.is1024x600?n="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(n="1280x768-1280x720"),e=document.createElement("div"),e.setAttribute("class","bb-bb10-radio-container-"+n+"-"+o),e.input=r,r.outerElement=e,r.res=n,r.style.display="none",r.radio=e,r.parentNode&&r.parentNode.insertBefore(e,r),e.appendChild(r),t=document.createElement("div"),t.setAttribute("class","bb-bb10-radio-dot-"+n),t.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%)",t.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%)",r.checked&&(t.style.background=t.highlight),e.dotDiv=t,e.appendChild(t),i=document.createElement("div"),i.setAttribute("class","bb-bb10-radio-dot-center-"+n),r.checked||bb.radio.resetDot(i),t.appendChild(i),t.centerDotDiv=i,t.slideOutUp=function(){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"),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)"},t.slideOutUp=t.slideOutUp.bind(t),t.slideOutDown=function(){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"),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)"},t.slideOutDown=t.slideOutDown.bind(t),t.slideIn=function(){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.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)"},t.slideIn=t.slideIn.bind(t),e.selectedRadio=void 0,e.slideFromTop=!0,e.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",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)},e.ontouchend=function(){this.input.checked||(this.dotDiv.style["-webkit-transition"]="none",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",window.setTimeout(this.doclick,0))},e.doclick=function(){if(!this.input.checked&&!this.input.disabled){var e=document.createEvent("HTMLEvents");e.initEvent("change",!1,!0),this.dotDiv.style.background=this.dotDiv.highlight,this.dotDiv.slideIn(),this.selectedRadio&&(this.selectedRadio.removeAttribute("checked"),this.selectedRadio.dispatchEvent(e),this.slideFromTop?this.selectedRadio.radio.dotDiv.slideOutDown():this.selectedRadio.radio.dotDiv.slideOutUp()),this.input.setAttribute("checked","true"),this.input.dispatchEvent(e)}},e.doclick=e.doclick.bind(e),e.getCurrentlyChecked=function(){var e=document.querySelectorAll("input[type=radio][name="+this.input.name+"][checked=true]");return e.length>0?e[0]:void 0},e.getCurrentlyChecked=e.getCurrentlyChecked.bind(e),e.getTop=function(e){for(var t=0;e;)t+=e.offsetTop,e=e.offsetParent;return t},r.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",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",window.setTimeout(this.outerElement.doclick,0))},r.setChecked=r.setChecked.bind(r),r.getChecked=function(){return this.checked},r.setChecked=r.setChecked.bind(r),r.enable=function(){this.disabled&&(this.disabled=!1,this.outerElement.dotDiv.setAttribute("class","bb-bb10-radio-dot-"+this.res))},r.enable=r.enable.bind(r),r.disable=function(){this.disabled||(this.disabled=!0,this.outerElement.dotDiv.setAttribute("class","bb-bb10-radio-dot-"+this.res+"-disabled"))},r.disable=r.disable.bind(r),r.isEnabled=function(){return!this.disabled},r.isEnabled=r.isEnabled.bind(r),r.show=function(){this.outerElement.style.display="block",bb.refresh()},r.show=r.show.bind(r),r.hide=function(){this.outerElement.style.display="none",bb.refresh()},r.hide=r.hide.bind(r),r.remove=function(){this.outerElement.parentNode.removeChild(this.outerElement),bb.refresh()},r.remove=r.remove.bind(r),e},resetDot:function(e){e.style["-webkit-transition"]="none",bb.device.is1024x600?(e.style.height="0px",e.style.width="0px",e.style.top="10px",e.style.left="9px"):(e.style.height="0px",e.style.width="0px",e.style.top="20px",e.style.left="20px")},enableGroup:function(e){var t=document.getElementsByName(e);for(i=0;t.length>i;i++)"radio"===t[i].type&&t[i].enable()},disableGroup:function(e){var t=document.getElementsByName(e);for(i=0;t.length>i;i++)"radio"===t[i].type&&t[i].disable()}},_bb10_roundPanel={apply:function(e){if(bb.device.isBB10){var t,i,n,o,r,s="1280x768-1280x720",l=bb.screen.listColor;for(bb.device.is1024x600?s="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(s="1280x768-1280x720"),t=0;e.length>t;t++){for(n=e[t],n.setAttribute("class","bb-bb10-round-panel-"+s),o=n.querySelectorAll("[data-bb-type=panel-header]"),i=0;o.length>i;i++)r=o[i],r.setAttribute("class","bb-bb10-panel-header-"+s+" bb-bb10-panel-header-"+s+"-"+l),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)}}else for(var t=0;e.length>t;t++){var n=e[t];n.setAttribute("class","bb-playbook-round-panel");for(var o=n.querySelectorAll("[data-bb-type=panel-header]"),i=0;o.length>i;i++)bb.device.isHiRes?o[i].setAttribute("class","bb-hires-panel-header"):o[i].setAttribute("class","bb-lowres-panel-header");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(e){var t,i,n,o=bb.screen.controlColor,n="1280x768-1280x720";for(bb.device.is1024x600?n="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(n="1280x768-1280x720"),t=0;e.length>t;t++)i=e[t],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-bb10-slider-"+n,outerElement.outer=document.createElement("div"),outerElement.outer.setAttribute("class","outer bb-bb10-slider-outer-"+o),outerElement.appendChild(outerElement.outer),outerElement.fill=document.createElement("div"),outerElement.fill.className="fill",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"),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.inner.appendChild(outerElement.halo),outerElement.indicator=document.createElement("div"),outerElement.indicator.setAttribute("class","indicator bb-bb10-slider-indicator-"+o),outerElement.inner.appendChild(outerElement.indicator),i.outerElement=outerElement,i.setValue=function(e){var t,i=0;e&&(parseInt(this.outerElement.minValue)>e||e>parseInt(this.outerElement.maxValue))||(e&&(this.outerElement.value=e,this.value=e,t=document.createEvent("HTMLEvents"),t.initEvent("change",!1,!0),this.dispatchEvent(t)),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(e){this.outerElement.isActivated===!1&&(this.outerElement.isActivated=!0,this.outerElement.initialXPos=e.touches[0].pageX,this.outerElement.halo.style["-webkit-transform"]="scale(1)",this.outerElement.halo.style["-webkit-animation-name"]="explode",this.outerElement.indicator.setAttribute("class","indicator bb-bb10-slider-indicator-"+o+" indicator-hover-"+o),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",this.outerElement.indicator.setAttribute("class","indicator bb-bb10-slider-indicator-"+o),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(e){this.isActivated===!0&&(e.stopPropagation(),e.preventDefault(),this.transientXPos=this.currentXPos+e.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 e=this.transientXPos/parseInt(window.getComputedStyle(this.outer).width),t=Math.ceil((parseInt(this.minValue)+parseInt(this.maxValue))*e);if(Math.abs(t-parseInt(this.range.value))>this.step){this.range.value=t;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(e){for(var t=0;e.length>t;t++)bb.textInput.style(e[t])},style:function(e){var t="1280x768-1280x720",i="",n=document.createElement("div");if(bb.device.is1024x600?t="1024x600":bb.device.is1280x768||bb.device.is1280x720?t="1280x768-1280x720":bb.device.is720x720&&(t="720x720"),e.hasAttribute("class")&&(i=e.getAttribute("class")),e.parentNode&&e.parentNode.insertBefore(n,e),n.appendChild(e),n.input=e,n.setAttribute("data-bb-type","input"),n.normal="bb-bb10-input-container bb-bb10-input-container-"+t,e.normal=i+" bb-bb10-input bb-bb10-input-"+t,e.focused=i+" bb-bb10-input bb-bb10-input-focused-"+t,e.disabled?e.setAttribute("class",e.normal+" bb-bb10-input-disabled"):e.setAttribute("class",e.normal),e.isFocused=!1,e.clickCount=0,e.container=n,e.clearBtn="none"!=e.getAttribute("data-bb-clear"),e.hasClearBtn=!1,e.type){var o=e.type.toLowerCase();("date"==o||"time"==o||"datetime"==o||"month"==o||"datetime-local"==o||"color"==o||"search"==o)&&(e.clearBtn=!1)}return e.disabled?n.setAttribute("class",n.normal+" bb-bb10-input-container-disabled"):n.setAttribute("class",n.normal),e.doFocus=function(){0==this.readOnly&&(this.container.setAttribute("class",this.container.normal+" bb-bb10-input-cancel-button bb-bb10-input-container-focused-"+t),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)},e.doFocus=e.doFocus.bind(e),e.addEventListener("focus",e.doFocus,!1),e.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},e.doBlur=e.doBlur.bind(e),e.addEventListener("blur",e.doBlur,!1),e.updateClearButton=function(){this.clearBtn&&(0==this.value.length&&this.hasClearBtn||this.value.length>0&&!this.hasClearBtn)&&e.doFocus()},e.updateClearButton=e.updateClearButton.bind(e),e.addEventListener("input",e.updateClearButton,!1),e.clearBtn&&(e.container.ontouchstart=function(t){t.target==this&&(t.preventDefault(),t.stopPropagation(),this.input.value="",e.doFocus())}),e.show=function(){this.container.style.display=""},e.show=e.show.bind(e),e.hide=function(){this.container.style.display="none"},e.hide=e.hide.bind(e),e.remove=function(){this.container.parentNode&&this.container.parentNode.removeChild(this.container)},e.remove=e.remove.bind(e),e.enable=function(){this.disabled&&(this.disabled=!1,this.container.setAttribute("class",this.container.normal),this.setAttribute("class",this.normal))},e.enable=e.enable.bind(e),e.disable=function(){this.disabled||(this.disabled=!0,this.container.setAttribute("class",this.container.normal+" bb-bb10-input-container-disabled"),this.setAttribute("class",this.normal+" bb-bb10-input-disabled"))},e.disable=e.disable.bind(e),n}},_bb10_toggle={apply:function(e){for(var t=0;e.length>t;t++)bb.toggle.style(e[t],!0)},style:function(outerElement,offdom){var res="1280x768-1280x720",table,tr,td,color=bb.screen.controlColor;return bb.device.is1024x600?res="1024x600":(bb.device.is1280x768||bb.device.is1280x720)&&(res="1280x768-1280x720"),outerElement.checked=!1,outerElement.enabled=!0,outerElement.buffer=bb.device.is1024x600?35:70,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-bb10-toggle-"+res,outerElement.outer=document.createElement("div"),outerElement.normal=outerElement.enabled?"outer bb-bb10-toggle-outer-"+color+" bb-bb10-toggle-outer-enabled-"+color:"outer bb-bb10-toggle-outer-"+color+" bb-bb10-toggle-outer-disabled",outerElement.outer.setAttribute("class",outerElement.normal),outerElement.appendChild(outerElement.outer),outerElement.fill=document.createElement("div"),outerElement.fill.className="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"),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-bb10-toggle-indicator-enabled-"+color:"indicator bb-bb10-toggle-indicator-disabled-"+color,outerElement.indicator.setAttribute("class",outerElement.indicator.normal),outerElement.container.appendChild(outerElement.indicator),outerElement.hasAttribute("onchange")&&(outerElement.onchangeEval=outerElement.getAttribute("onchange"),outerElement.onchange=function(){eval(this.onchangeEval)}),outerElement.inner.animateBegin=function(e){this.outerElement.enabled&&this.outerElement.isActivated===!1&&(this.outerElement.startValue=this.outerElement.checked,this.outerElement.movedWithSlider=!1,this.outerElement.isActivated=!0,this.outerElement.initialXPos=e.touches[0].pageX,this.outerElement.halo.style["-webkit-transform"]="scale(1)",this.outerElement.halo.style["-webkit-animation-name"]="explode",this.outerElement.indicator.setAttribute("class","indicator bb-bb10-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-bb10-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(e){if(this.enabled&&this.isActivated===!0){this.movedWithSlider=!0,e.stopPropagation(),e.preventDefault();var t,i=parseInt(window.getComputedStyle(this.fill).width)-this.buffer;this.transientXPos=this.currentXPos+e.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)",t=this.transientXPos/i,this.checked=t>.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 e=this.checked?parseInt(window.getComputedStyle(this.fill).width)-this.buffer:0;this.inner.style["-webkit-transform"]="translate3d("+e+"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("+e+"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.indicator.style["background-image"]=this.checked&&this.enabled?"-webkit-linear-gradient(top, "+bb.options.highlightColor+" 0%, "+bb.options.shades.darkHighlight+" 100%)":"",this.currentXPos=e},outerElement.positionButton=outerElement.positionButton.bind(outerElement),outerElement.setChecked=function(e){e!=this.checked&&(this.checked=e,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(e){this.yes.innerHTML=e},outerElement.setOnCaption=outerElement.setOnCaption.bind(outerElement),outerElement.setOffCaption=function(e){this.no.innerHTML=e},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,this.indicator.normal="indicator bb-bb10-toggle-indicator-enabled-"+color,this.indicator.setAttribute("class",this.indicator.normal),this.normal="outer bb-bb10-toggle-outer-"+color+" bb-bb10-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,this.indicator.normal="indicator bb-bb10-toggle-indicator-disabled-"+color,this.indicator.setAttribute("class",this.indicator.normal),this.normal="outer bb-bb10-toggle-outer-"+color+" bb-bb10-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}},_bb5_button={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t],n=i.innerHTML,o="bb5-button",r="bb5-button-highlight";i.innerHTML="",i.setAttribute("class","bb-bb5-button");var s=document.createElement("a");s.setAttribute("class",o),s.setAttribute("x-blackberry-focusable","true"),s.setAttribute("onmouseover","this.setAttribute('class','"+r+"')"),s.setAttribute("onmouseout","this.setAttribute('class','"+o+"')"),i.appendChild(s);var l=document.createElement("span");l.innerHTML=n,s.appendChild(l)}}},_bb5_labelControlContainers={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t];i.setAttribute("class","bb-label-control-horizontal-row");for(var n=i.querySelectorAll("[data-bb-type=label]"),o=0;n.length>o;o++){var r=n[o];r.setAttribute("class","bb-label")}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)}}},_bb5_pillButtons={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t];i.setAttribute("class","bb-pill-buttons");for(var n=i.querySelectorAll("[data-bb-type=pill-button]"),o=0;n.length>o;o++){var r=n[o];r.setAttribute("x-blackberry-focusable","true");var s=r.innerHTML;r.innerHTML="<span>"+s+"</span>",0===o?r.setAttribute("class","buttonLeft"):o==n.length-1?r.setAttribute("class","buttonRight"):r.setAttribute("class","buttonMiddle"),r.hasAttribute("data-bb-selected")&&"true"==r.getAttribute("data-bb-selected").toLowerCase()&&bb.pillButtons.selectButton(r),r.onmousedown=function(){bb.pillButtons.selectButton(this);for(var e=this.parentNode.querySelectorAll("[data-bb-type=pill-button]"),t=0;e.length>t;t++){var i=e[t];i!=this&&bb.pillButtons.deSelectButton(i)}}}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)}}},_bb_5_6_7_imageList={apply:function(e){for(var t,i,n,o,t=0;e.length>t;t++){n=e[t],n.items=[],n.hideImages=n.hasAttribute("data-bb-images")?"none"==n.getAttribute("data-bb-images").toLowerCase():!1,n.hideImages||(n.imagePlaceholder=n.hasAttribute("data-bb-image-placeholder")?n.getAttribute("data-bb-image-placeholder"):void 0),n.headerJustify=n.hasAttribute("data-bb-header-justify")?n.getAttribute("data-bb-header-justify").toLowerCase():"center",n.listStyle=n.hasAttribute("data-bb-style")?n.getAttribute("data-bb-style").toLowerCase():"default",bb.device.isHiRes?n.setAttribute("class","bb-hires-image-list"):n.setAttribute("class","bb-lowres-image-list"),n.styleItem=function(e){var e,t,i,n,o,r,s,l,a,b,d,c,h,u,p=bb.device.isHiRes?"hires":"lowres";e.hasAttribute("data-bb-type")&&(t=e.getAttribute("data-bb-type").toLowerCase(),i=e.innerHTML,n="",e.hasAttribute("data-bb-accent-text")&&(n=e.getAttribute("data-bb-accent-text")),"header"==t?(o="bb-"+p+"-image-list-header",r="bb-"+p+"-image-list-header-hover","left"==this.headerJustify?(o=o+" bb-"+p+"-image-list-header-left",r=r+" bb-"+p+"-image-list-header-left"):"right"==this.headerJustify?(o=o+" bb-"+p+"-image-list-header-right",r=r+" bb-"+p+"-image-list-header-right"):(o=o+" bb-"+p+"-image-list-header-center",r=r+" bb-"+p+"-image-list-header-center"),e.normal=o,e.highlight=r,e.innerHTML="<p>"+i+"</p>",e.setAttribute("x-blackberry-focusable","true"),e.setAttribute("class",o),e.setAttribute("onmouseover","this.setAttribute('class',this.highlight)"),e.setAttribute("onmouseout","this.setAttribute('class',this.normal)")):"item"==t&&(e.innerHTML="",e.setAttribute("class","bb-"+p+"-image-list-item"),e.setAttribute("onmouseover","this.setAttribute('class','bb-"+p+"-image-list-item bb-"+p+"-image-list-item-hover')"),e.setAttribute("onmouseout","this.setAttribute('class','bb-"+p+"-image-list-item')"),e.setAttribute("x-blackberry-focusable","true"),this.hideImages||(d=document.createElement("img"),e.img=d,this.imagePlaceholder?(d.placeholder=this.imagePlaceholder,d.src=e.hasAttribute("data-bb-img")?e.getAttribute("data-bb-img"):this.imagePlaceholder,d.onerror=function(){this.src!=this.placeholder&&(this.src=this.placeholder)}):d.setAttribute("src",e.getAttribute("data-bb-img")),e.appendChild(d)),s=document.createElement("div"),e.appendChild(s),s.normal=this.hideImages?"bb-"+p+"-image-list-details bb-"+p+"-image-list-noimage":"bb-"+p+"-image-list-details",l=document.createElement("div"),l.innerHTML=e.getAttribute("data-bb-title"),l.className="title",e.titleDiv=l,s.appendChild(l),"arrowlist"==this.listStyle?(s.normal=s.normal+" details-button-margin",c=document.createElement("div"),e.appendChild(c),e.btn=c,c.setAttribute("class","button"),h=document.createElement("div"),h.normal="bb-"+p+"-image-list-item-button-border",h.setAttribute("class",h.normal),c.appendChild(h),u=document.createElement("div"),u.setAttribute("class","bb-"+p+"-image-list-item-button-inner bb-image-list-item-chevron-light"),h.appendChild(u)):(b=document.createElement("div"),b.innerHTML=n,b.className="accent-text",e.accentDiv=b,s.appendChild(b)),s.setAttribute("class",s.normal),a=document.createElement("div"),a.className="description",e.descriptionDiv=a,s.appendChild(a),0==i.length&&(i=" ",a.style.visibilty="hidden",l.style["margin-top"]=bb.device.isHiRes?"14px":"18px",b&&(b.style["margin-top"]=bb.device.isHiRes?"-32px":"-25px"),"arrowlist"==this.listStyle&&(c.style["margin-top"]=bb.device.isHiRes?"-73px":"-70px")),a.innerHTML=i,e.remove=function(){var e=this.parentNode,t=e.items.indexOf(this);this.parentNode.removeChild(this),e.items.splice(t,1),bb.scroller&&bb.scroller.refresh()},e.remove=e.remove.bind(e),e.trappedClick=e.onclick,e.onclick=void 0,e.outerElement=this,e.addEventListener("click",function(){this.outerElement.selected=this,this.trappedClick&&this.trappedClick()},!1),e.getTitle=function(){return this.titleDiv.innerHTML},e.getTitle=e.getTitle.bind(e),e.getDescription=function(){return this.descriptionDiv.innerHTML},e.getDescription=e.getDescription.bind(e),e.getAccentText=function(){return this.accentDiv?this.accentDiv.innerHTML:void 0},e.getAccentText=e.getAccentText.bind(e),e.getImage=function(){return this.img?this.img.getAttribute("src"):void 0},e.getImage=e.getImage.bind(e)))},n.styleItem=n.styleItem.bind(n),n.appendItem=function(e){this.styleItem(e),this.appendChild(e),this.items.push(e),bb.scroller&&bb.scroller.refresh()},n.appendItem=n.appendItem.bind(n),n.refresh=function(e){if(e&&e.length&&!(0>=e.length)){var t,i,n=document.createElement("div");for(this.items=[],t=0;e.length>t;t++)i=e[t],this.styleItem(i),this.items.push(i),n.appendChild(i);this.innerHTML="",this.appendChild(n)}},n.refresh=n.refresh.bind(n),n.insertItemBefore=function(e,t){this.styleItem(e),this.insertBefore(e,t),this.items.splice(this.items.indexOf(t),0,e),bb.scroller&&bb.scroller.refresh()},n.insertItemBefore=n.insertItemBefore.bind(n),n.getItems=function(){var e,t=[];for(e=0;this.items.length>e;e++)t.push(this.items[e]);return t},n.getItems=n.getItems.bind(n),n.clear=function(){this.items=[],n.innerHTML="",bb.scroller&&bb.scroller.refresh()},n.clear=n.clear.bind(n),n.show=function(){this.style.display="block",bb.scroller&&bb.scroller.refresh()},n.show=n.show.bind(n),n.hide=function(){this.style.display="none",bb.scroller&&bb.scroller.refresh()},n.hide=n.hide.bind(n),n.remove=function(){this.parentNode.removeChild(this),bb.scroller&&bb.scroller.refresh()},n.remove=n.remove.bind(n),o=n.querySelectorAll("[data-bb-type=item], [data-bb-type=header]");var r;for(i=0;o.length>i;i++)r=o[i],n.styleItem(r),n.items.push(r)}}},_bb_5_6_7_roundPanel={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t];if(i.setAttribute("class","bb-round-panel"),i.hasChildNodes()){for(var n=[],o=i.childNodes.length,r=0;o>r;r++)n.push(i.childNodes[r]);for(var r=o-1;r>=0;r--)i.removeChild(i.childNodes[r]);var s=document.createElement("div");s.setAttribute("class","bb-round-panel-top-left bb-round-panel-background "),i.appendChild(s),s=document.createElement("div"),s.setAttribute("class","bb-round-panel-top-right bb-round-panel-background "),i.appendChild(s);var l=document.createElement("div");l.setAttribute("class","bb-round-panel-inside"),i.appendChild(l),s=document.createElement("div"),s.setAttribute("class","bb-round-panel-bottom-left bb-round-panel-background "),i.appendChild(s),s=document.createElement("div"),s.setAttribute("class","bb-round-panel-bottom-right bb-round-panel-background "),i.appendChild(s);for(var r=0;n.length>r;r++)l.appendChild(n[r])}for(var a=i.querySelectorAll("[data-bb-type=panel-header]"),r=0;a.length>r;r++)a[r].setAttribute("class","bb-lowres-panel-header");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)}}},_bb_6_7_button={apply:function(e){for(var t=0;e.length>t;t++)bb.button.style(e[t])},style:function(e){var t=e.hasAttribute("data-bb-disabled"),i="bb-bb7-button",n="bb-bb7-button-highlight";if(e.stretched=!1,e.enabled=!t,t&&(i="bb-bb7-button-disabled",e.removeAttribute("data-bb-disabled")),bb.device.isHiRes?(i+=" bb-bb7-button-hires",n+=" bb-bb7-button-hires"):(i+=" bb-bb7-button-lowres",n+=" bb-bb7-button-lowres"),e.hasAttribute("data-bb-style")){var o=e.getAttribute("data-bb-style");"stretch"==o&&(e.stretched=!0,i+=" button-stretch",n+=" button-stretch")}return e.highlight=n,e.normal=i,e.setAttribute("class",i),t||(e.setAttribute("x-blackberry-focusable","true"),e.onmouseover=function(){this.setAttribute("class",this.highlight)},e.onmouseout=function(){this.setAttribute("class",this.normal)}),e.trappedClick=e.onclick,e.onclick=void 0,null!==e.trappedClick&&e.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1),e.setCaption=function(e){this.innerHTML=e},e.setCaption=e.setCaption.bind(e),e.getCaption=function(){return this.innerHTML},e.getCaption=e.getCaption.bind(e),e.setImage=function(){},e.setImage=e.setImage.bind(e),e.getImage=function(){return""},e.getImage=e.getImage.bind(e),e.enable=function(){this.enabled||(this.setAttribute("class",i),this.setAttribute("x-blackberry-focusable","true"),this.onmouseover=function(){this.setAttribute("class",this.highlight)},this.onmouseout=function(){this.setAttribute("class",this.normal)},this.enabled=!0)},e.enable=e.enable.bind(e),e.disable=function(){if(this.enabled){var e="bb-bb7-button-disabled";if(e+=bb.device.isHiRes?" bb-bb7-button-hires":" bb-bb7-button-lowres",this.hasAttribute("data-bb-style")){var t=this.getAttribute("data-bb-style");"stretch"==t&&(e+=" button-stretch",n+=" button-stretch")}this.setAttribute("class",e),this.removeAttribute("x-blackberry-focusable"),this.onmouseover=null,this.onmouseout=null,this.enabled=!1}},e.disable=e.disable.bind(e),e.show=function(){this.style.display=this.stretched?"block":"inline-block"},e.show=e.show.bind(e),e.hide=function(){this.style.display="none"},e.hide=e.hide.bind(e),e.remove=function(){this.parentNode.removeChild(this),bb.refresh()},e.remove=e.remove.bind(e),e}},_bb_6_7_PlayBook_dropdown={apply:function(e){for(var t=0;e.length>t;t++)bb.dropdown.style(e[t])},style:function(e){var t,i,n=e.getElementsByTagName("option"),o="",r=!e.hasAttribute("disabled");bb.device.isPlayBook?(t="ontouchstart",i="ontouchend"):(t="onmouseover",i="onmouseout"),e.style.display="none",e.stretch=!1,e.enabled=r,n.length>0&&(o=n[0].innerHTML);for(var s=0;n.length>s;s++)if(n[s].hasAttribute("selected")){o=n[s].innerHTML;break}var l=document.createElement("div");l.innerHTML='<div data-bb-type="caption"><span>'+o+"</span></div>",e.dropdown=l;var a="bb-bb7-dropdown",b="bb-bb7-dropdown-highlight";if(bb.device.isHiRes?(a+=" bb-bb7-dropdown-hires",b+=" bb-bb7-dropdown-hires"):(a+=" bb-bb7-dropdown-lowres",b+=" bb-bb7-dropdown-lowres"),e.hasAttribute("data-bb-style")){var d=e.getAttribute("data-bb-style");"stretch"==d&&(e.stretch=!0,a+=" dropdown-stretch",b+=" dropdown-stretch")}return l.setAttribute("data-bb-type","dropdown"),e.enabled?l.setAttribute("class",a):l.setAttribute("class",a+" bb-bb7-dropdown-disabled"),l.setAttribute("x-blackberry-focusable","true"),l.inEvent="this.setAttribute('class','"+b+"')",l.outEvent="this.setAttribute('class','"+a+"')",e.parentNode&&e.parentNode.insertBefore(l,e),l.appendChild(e),l.doclick=function(){var e=this.getElementsByTagName("select")[0];if(bb.device.isPlayBook||bb.device.isRipple){var t=document.createElement("div");t.setAttribute("id","ripple-dropdown-overlay"),t.style.position="absolute",t.style.left="0px",t.style.top=document.body.scrollTop+"px",t.style.width="100%",t.style.height="100%",t.style["z-index"]="1000000",t.onclick=function(){null!==this.parentNode&&this.parentNode.removeChild(this)};var i=document.createElement("div");bb.device.isHiRes?i.setAttribute("class","ripple-dropdown-dialog bb-hires-screen"):i.setAttribute("class","ripple-dropdown-dialog"),t.appendChild(i),i.onclick=function(){this.parentNode.parentNode.removeChild(this.parentNode)};for(var n=0;e.options.length>n;n++){var o=e.options[n],r=document.createElement("div");i.appendChild(r);var s=document.createElement("div");o.selected?(s.setAttribute("class","item selected"),r.setAttribute("class","backgroundHighlight backgroundSelected")):(s.setAttribute("class","item"),r.setAttribute("class","backgroundHighlight")),s.innerHTML="<span>"+o.text+"</span>",s.setAttribute("x-blackberry-focusable","true"),s.setAttribute("data-bb-index",n),s.dropdown=this,s.onclick=function(){var e=this.getAttribute("data-bb-index"),t=this.dropdown.getElementsByTagName("select")[0];t&&t.setSelectedItem(e)},r.appendChild(s)}var l=45*e.options.length+20,a=window.innerHeight-80;l>a&&(l=a,i.style.height=a+"px");var b=window.innerHeight/2-l/2;i.style.top=b+"px",document.body.appendChild(t)}else{for(var d=[],n=0;e.options.length>n;n++)d[n]={label:e.options[n].text,selected:n==e.selectedIndex,enabled:!0,type:"option"};try{blackberry.ui.dialog.selectAsync(!1,d,function(t){t.length>0&&t[0]<e.options.length&&e.setSelectedItem(t[0])})}catch(c){console.log("Exception in selectAsync: "+c)}}},e.enabled&&(l.onclick=l.doclick,l.setAttribute(t,l.inEvent),l.setAttribute(i,l.outEvent)),e.setSelectedItem=function(e){var t=this.dropdown.getElementsByTagName("select")[0];if(t&&t.selectedIndex!=e){t.selectedIndex=e;var i=this.dropdown.querySelectorAll("[data-bb-type=caption]")[0];i&&(i.innerHTML="<span>"+t.options[e].text+"</span>");var n=document.createEvent("HTMLEvents");n.initEvent("change",!1,!0),t.dispatchEvent(n)}},e.setSelectedText=function(e){for(var t=0;this.options.length>t;t++)if(this.options[t].text==e)return this.setSelectedItem(t),void 0},e.setSelectedText=e.setSelectedText.bind(e),e.fireEvent=function(){var e=document.createEvent("HTMLEvents");e.initEvent("change",!1,!0),this.dispatchEvent(e)},e.fireEvent=e.fireEvent.bind(e),e.enable=function(){this.enabled||(this.dropdown.onclick=this.dropdown.doclick,this.dropdown.setAttribute(t,l.inEvent),this.dropdown.setAttribute(i,l.outEvent),this.dropdown.setAttribute("class",a),this.removeAttribute("disabled"),this.enabled=!0)},e.enable=e.enable.bind(e),e.disable=function(){e.enabled&&(this.dropdown.onclick=null,this.dropdown.removeAttribute(t),this.dropdown.removeAttribute(i),this.dropdown.setAttribute("class",a+" bb-bb7-dropdown-disabled"),this.enabled=!1,this.setAttribute("disabled","disabled"))},e.disable=e.disable.bind(e),e.show=function(){this.dropdown.style.display=this.stretch?"block":"table-cell",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.dropdown.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.dropdown.parentNode.removeChild(this.dropdown),bb.refresh()},e.remove=e.remove.bind(e),e.refresh=function(){var e,t=this.getElementsByTagName("option"),i="";t.length>0&&(i=t[0].innerHTML);for(var n=0;t.length>n;n++)if(t[n].hasAttribute("selected")){i=t[n].innerHTML;break}e=this.dropdown.querySelectorAll("[data-bb-type=caption]")[0],e&&(e.innerHTML="<span>"+i+"</span>")},e.refresh=e.refresh.bind(e),e.setCaption=function(){console&&console.log("WARNING: setCaption is not supported on BlackBerry 5/6/7/PlayBook")},e.setCaption=e.setCaption.bind(e),l}},_bb_6_7_PlayBook_labelControlContainers={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t],n=i.querySelectorAll("[data-bb-type=row]");if(n.length>0){var o=document.createElement("table");o.setAttribute("class","bb-bb7-label-control-rows"),i.insertBefore(o,n[0]);for(var r=0;n.length>r;r++){var s=n[r],l=document.createElement("tr");o.appendChild(l);var a=document.createElement("td");l.appendChild(a);var b=s.querySelectorAll("[data-bb-type=label]")[0];s.removeChild(b),a.appendChild(b);var d=document.createElement("td");l.appendChild(d);var c=s.querySelectorAll("[data-bb-type=button],input,[data-bb-type=dropdown],textarea")[0];s.removeChild(c),d.appendChild(c),i.removeChild(s);var h=c.getAttribute("data-bb-type");"button"==h||"dropdown"==h?c.style.float="right":"INPUT"==c.tagName&&(c.style.width="100%")}}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)}}},_bb_6_7_PlayBook_pillButtons={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t],n="bb-bb7-pill-buttons",o="";bb.device.isHiRes?(n+=" bb-bb7-pill-buttons-hires",o="bb-bb7-pill-button-hires"):(n+=" bb-bb7-pill-buttons-lowres",o="bb-bb7-pill-button-lowres"),i.setAttribute("class",n);var r,s,l=i.querySelectorAll("[data-bb-type=pill-button]"),a=Math.floor(98/l.length),b=102-a*l.length;bb.device.isPlayBook?(r="ontouchstart",s="ontouchend"):(r="onmouseover",s="onmouseout"),i.style["padding-left"]=b+"%",i.style["padding-right"]=b+"%";for(var d=0;l.length>d;d++){var c=l[d];c.setAttribute("x-blackberry-focusable","true"),0===d?"true"==c.getAttribute("data-bb-selected")?c.setAttribute("class","bb-bb7-pill-button-highlight bb-bb7-pill-button-left "+o):(c.setAttribute("class","bb-bb7-pill-button bb-bb7-pill-button-left "+o),c.setAttribute(r,"this.setAttribute('class','bb-bb7-pill-button-highlight bb-bb7-pill-button-left "+o+"')"),c.setAttribute(s,"this.setAttribute('class','bb-bb7-pill-button bb-bb7-pill-button-left "+o+"')")):d==l.length-1?"true"==c.getAttribute("data-bb-selected")?c.setAttribute("class","bb-bb7-pill-button-highlight bb-bb7-pill-button-right "+o):(c.setAttribute("class","bb-bb7-pill-button bb-bb7-pill-button-right "+o),c.setAttribute(r,"this.setAttribute('class','bb-bb7-pill-button-highlight bb-bb7-pill-button-right "+o+"')"),c.setAttribute(s,"this.setAttribute('class','bb-bb7-pill-button bb-bb7-pill-button-right "+o+"')")):"true"==c.getAttribute("data-bb-selected")?c.setAttribute("class","bb-bb7-pill-button-highlight "+o):(c.setAttribute("class","bb-bb7-pill-button "+o),c.setAttribute(r,"this.setAttribute('class','bb-bb7-pill-button-highlight "+o+"')"),c.setAttribute(s,"this.setAttribute('class','bb-bb7-pill-button "+o+"')")),c.style.width=a+"%",c.addEventListener("click",function(){var e,t,i=this.parentNode.querySelectorAll("[data-bb-type=pill-button]");bb.device.isPlayBook?(e="ontouchstart",t="ontouchend"):(e="onmouseover",t="onmouseout");for(var n=0;i.length>n;n++){var r=i[n];0===n?r==this?(r.setAttribute("class","bb-bb7-pill-button-highlight bb-bb7-pill-button-left "+o),r.onmouseover=null,r.onmouseout=null):(r.setAttribute("class","bb-bb7-pill-button bb-bb7-pill-button-left "+o),r.setAttribute(e,"this.setAttribute('class','bb-bb7-pill-button-highlight bb-bb7-pill-button-left "+o+"')"),r.setAttribute(t,"this.setAttribute('class','bb-bb7-pill-button bb-bb7-pill-button-left "+o+"')")):n==i.length-1?r==this?(r.setAttribute("class","bb-bb7-pill-button-highlight bb-bb7-pill-button-right "+o),r.onmouseover=null,r.onmouseout=null):(r.setAttribute("class","bb-bb7-pill-button bb-bb7-pill-button-right "+o),r.setAttribute(e,"this.setAttribute('class','bb-bb7-pill-button-highlight bb-bb7-pill-button-right "+o+"')"),r.setAttribute(t,"this.setAttribute('class','bb-bb7-pill-button bb-bb7-pill-button-right "+o+"')")):r==this?(r.setAttribute("class","bb-bb7-pill-button-highlight "+o),r.onmouseover=null,r.onmouseout=null):(r.setAttribute("class","bb-bb7-pill-button "+o),r.setAttribute(e,"this.setAttribute('class','bb-bb7-pill-button-highlight "+o+"')"),r.setAttribute(t,"this.setAttribute('class','bb-bb7-pill-button "+o+"')"))}},!1)}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),i.getButtons=function(){for(var e=this.querySelectorAll("[data-bb-type=pill-button]"),t=[],i=0;e.length>i;i++)t[i]=e[i].innerHTML;return t},i.getButtons=i.getButtons.bind(i)}}},_bb_6_7_textInput={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t],n=i.getAttribute("class");n+=" bb-bb7-input",n+=bb.device.isHiRes?" bb-bb7-input-hires":" bb-bb7-input-lowres",i.setAttribute("class",n)}}},_bb_PlayBook_10_scrollPanel={apply:function(e){var t,i,n,o,r;for(t=0;e.length>t;t++){for(n=e[t],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(e){bb.scroller&&bb.scroller.disable(),e.preventDefault()},onBeforeScrollEnd:function(){bb.scroller&&bb.scroller.enable()},onScrollEnd:function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)},onScrollMove:function(e){n.onscroll&&n.onscroll(e),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)},!1)),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(e,t){this.scroller?this.scroller.scrollTo(e,t):this.scrollTop=e},n.scrollTo=n.scrollTo.bind(n),n.scrollToElement=function(e){if(this.scroller)this.scroller.scrollToElement(e);else{if(!e)return;var t=0,i=e;if(i.offsetParent)do t+=i.offsetTop;while(i=i.offsetParent);this.scrollTo(t,0)}},n.scrollToElement=n.scrollToElement.bind(n),n.setAttribute("class","bb-scroll-panel")}}},_bbPlayBook_activityIndicator={apply:function(e){var t,i,n,o,r,s,l,a=bb.screen.controlColor;if(e.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(),l=c.toDataURL()}for(t=0;e.length>t;t++)return i=e[t],r=i.hasAttribute("data-bb-size")?i.getAttribute("data-bb-size").toLowerCase():"medium","large"==r?s="93px":"small"==r?s="21px":(r="medium",s="46px"),i.style.width=s,o=document.createElement("div"),o.setAttribute("class","bb-pb-activity-margin bb-pb-activity-"+r+" bb-activity-"+a),i.appendChild(o),n=document.createElement("div"),n.setAttribute("class","bb-pb-activity-"+r),n.style["background-image"]='url("'+l+'")',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),i}},_bbPlayBook_button={apply:function(e){for(var t=0;e.length>t;t++)bb.button.style(e[t])},style:function(e){var t,i,n,o,r=document.createElement("div"),s=document.createElement("div");if(disabled=e.hasAttribute("data-bb-disabled"),normal="bb-pb-button",highlight="bb-pb-button-container bb-pb-button-container-"+bb.screen.controlColor+" pb-button-"+bb.screen.controlColor+"-highlight",outerNormal="bb-pb-button-container bb-pb-button-container-"+bb.screen.controlColor+" bb-pb-button-font-"+bb.screen.controlColor,outerNormalWithoutImageOnly=outerNormal,e.isImageOnly=!1,e.enabled=!disabled,n=e.innerHTML,r.innerHTML=n,e.innerHTML="",e.stretched=!1,e.captionElement=r,e.appendChild(s),e.innerElement=s,e.hasAttribute("data-bb-style")){var l=e.getAttribute("data-bb-style");"stretch"==l&&(e.stretched=!0,outerNormal+=" bb-pb-button-stretch",highlight+=" bb-pb-button-stretch")}return i=e.hasAttribute("data-bb-img")?e.getAttribute("data-bb-img"):void 0,i&&(n&&0!=n.length?(r.setAttribute("class","bb-pb-button-caption-with-image"),o=document.createElement("div"),e.imgElement=o,o.setAttribute("class","bb-pb-button-image"),o.style["background-image"]='url("'+i+'")',s.appendChild(o)):(outerNormal+=" bb-pb-button-container-image-only",highlight+=" bb-pb-button-container-image-only",r.style["background-image"]='url("'+i+'")',e.style["line-height"]="0px",r.setAttribute("class","bb-pb-button-caption-with-image-only"),e.isImageOnly=!0)),s.appendChild(r),t=normal+" bb-pb-button-disabled-"+bb.screen.controlColor,normal=normal+" bb-pb-button-"+bb.screen.controlColor,disabled?(e.removeAttribute("data-bb-disabled"),s.setAttribute("class",t)):s.setAttribute("class",normal),e.setAttribute("class",outerNormal),e.outerNormal=outerNormal,e.highlight=highlight,e.outerNormalWithoutImageOnly=outerNormalWithoutImageOnly,e.innerElement=s,s.normal=normal,s.disabledStyle=t,disabled||(e.ontouchstart=function(){this.setAttribute("class",this.highlight)},e.ontouchend=function(){this.setAttribute("class",this.outerNormal),this.style.color=""}),e.trappedClick=e.onclick,e.onclick=void 0,null!==e.trappedClick&&e.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1),e.setCaption=function(e){if(this.isImageOnly&&e.length>0){this.captionElement.setAttribute("class","bb-pb-button-caption-with-image");var t=document.createElement("div");this.imgElement=t,t.setAttribute("class","bb-pb-button-image"),t.style["background-image"]=this.captionElement.style["background-image"],this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(t),this.innerElement.appendChild(this.captionElement),this.setAttribute("class",this.outerNormalWithoutImageOnly),this.captionElement.style["background-image"]="",this.isImageOnly=!1}else 0==e.length&&this.imgElement&&(this.captionElement.setAttribute("class","bb-pb-button-caption-with-image-only"),this.setAttribute("class",this.outerNormalWithoutImageOnly+" bb-pb-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=e},e.getCaption=function(){return this.captionElement.innerHTML},e.getCaption=e.getCaption.bind(e),e.setImage=function(e){if(this.isImageOnly)this.captionElement.style["background-image"]='url("'+e+'")';else if(this.imgElement&&e.length>0)this.imgElement.style["background-image"]='url("'+e+'")';else if(e.length>0){this.captionElement.setAttribute("class","bb-pb-button-caption-with-image");var t=document.createElement("div");this.imgElement=t,t.setAttribute("class","bb-pb-button-image"),t.style["background-image"]='url("'+e+'")',this.innerElement.removeChild(this.captionElement),this.innerElement.appendChild(t),this.innerElement.appendChild(this.captionElement)}else this.imgElement&&0==e.length&&(this.innerElement.removeChild(this.imgElement),this.imgElement=null,this.captionElement.setAttribute("class",""))
},e.getImage=function(){return this.isImageOnly?this.captionElement.style["background-image"].slice(4,-1):this.imgElement?this.imgElement.style["background-image"].slice(4,-1):""},e.getImage=e.getImage.bind(e),e.enable=function(){this.enabled||(this.innerElement.setAttribute("class",this.innerElement.normal),this.ontouchstart=function(){this.setAttribute("class",this.highlight)},this.ontouchend=function(){this.setAttribute("class",this.outerNormal)},this.enabled=!0)},e.enable=e.enable.bind(e),e.disable=function(){this.enabled&&(this.innerElement.setAttribute("class",this.innerElement.disabledStyle),this.ontouchstart=null,this.ontouchend=null,this.enabled=!1)},e.disable=e.disable.bind(e),e.show=function(){this.style.display=this.stretched?"block":"inline-block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.parentNode.removeChild(this),bb.refresh()},e.remove=e.remove.bind(e),e}},_bbPlayBook_imageList={apply:function(e){for(var t,i,n,o,t=0;e.length>t;t++){n=e[t],n.items=[],n.hideImages=n.hasAttribute("data-bb-images")?"none"==n.getAttribute("data-bb-images").toLowerCase():!1,n.hideImages||(n.imagePlaceholder=n.hasAttribute("data-bb-image-placeholder")?n.getAttribute("data-bb-image-placeholder"):void 0),n.headerJustify=n.hasAttribute("data-bb-header-justify")?n.getAttribute("data-bb-header-justify").toLowerCase():"center",n.listStyle=n.hasAttribute("data-bb-style")?n.getAttribute("data-bb-style").toLowerCase():"default",n.headerStyle=n.hasAttribute("data-bb-header-style")?n.getAttribute("data-bb-header-style").toLowerCase():"default",n.setAttribute("class","bb-pb-image-list"),n.styleItem=function(e){var e,t,i,o,r,s,l,a,b,d,c,h,u,p;e.hasAttribute("data-bb-type")&&(t=e.getAttribute("data-bb-type").toLowerCase(),i=e.innerHTML,o="",e.hasAttribute("data-bb-accent-text")&&(o=e.getAttribute("data-bb-accent-text")),"header"==t?(r="bb-pb-image-list-header",s="bb-pb-image-list-header-hover bb10Highlight",r+="solid"==n.headerStyle?" bb-pb-image-list-header-solid bb10Accent":" bb-pb-image-list-header-default","left"==this.headerJustify?(r+=" bb-pb-image-list-header-left",s+=" bb-pb-image-list-header-left"):"right"==this.headerJustify?(r+=" bb-pb-image-list-header-right",s+=" bb-pb-image-list-header-right"):(r=r+" bb-"+res+"-image-list-header-center",s+=" bb-pb-image-list-header-center"),e.normal=r,e.highlight=s,e.innerHTML="<p>"+i+"</p>",e.setAttribute("class",r),e.ontouchstart=function(){this.setAttribute("class",this.highlight)},e.ontouchend=function(){this.setAttribute("class",this.normal)}):"item"==t&&(e.normal="bb-pb-image-list-item",e.highlight="bb-pb-image-list-item bb-pb-image-list-item-hover bb10Highlight",e.innerHTML="",e.setAttribute("class","bb-pb-image-list-item"),e.ontouchstart=function(){this.setAttribute("class",this.highlight)},e.ontouchend=function(){this.setAttribute("class",this.normal)},this.hideImages||(c=document.createElement("img"),e.img=c,this.imagePlaceholder?(c.placeholder=this.imagePlaceholder,c.src=e.hasAttribute("data-bb-img")?e.getAttribute("data-bb-img"):this.imagePlaceholder,c.onerror=function(){this.src!=this.placeholder&&(this.src=this.placeholder)}):c.setAttribute("src",e.getAttribute("data-bb-img")),e.appendChild(c)),l=document.createElement("div"),e.appendChild(l),l.normal=this.hideImages?"bb-pb-image-list-details bb-pb-image-list-noimage":"bb-pb-image-list-details",a=document.createElement("div"),a.innerHTML=e.getAttribute("data-bb-title"),a.className="title",e.titleDiv=a,l.appendChild(a),"arrowlist"==this.listStyle?(l.normal=l.normal+" details-button-margin",h=document.createElement("div"),e.appendChild(h),e.btn=h,h.setAttribute("class","button"),u=document.createElement("div"),u.normal="bb-pb-image-list-item-button-border",u.setAttribute("class",u.normal),h.appendChild(u),p=document.createElement("div"),p.setAttribute("class","bb-pb-image-list-item-button-inner bb-image-list-item-chevron-light"),u.appendChild(p)):(d=document.createElement("div"),d.innerHTML=o,d.className="accent-text",e.accentDiv=d,l.appendChild(d)),l.setAttribute("class",l.normal),b=document.createElement("div"),b.className="description",e.descriptionDiv=b,l.appendChild(b),0==i.length&&(i=" ",b.style.visibilty="hidden",a.style["margin-top"]="19px",d&&(d.style["margin-top"]="-23px"),"arrowlist"==this.listStyle&&(h.style["margin-top"]="-69px")),b.innerHTML=i,e.remove=function(){var e=this.parentNode,t=e.items.indexOf(this);this.parentNode.removeChild(this),e.items.splice(t,1),bb.scroller&&bb.scroller.refresh()},e.remove=e.remove.bind(e),e.trappedClick=e.onclick,e.onclick=void 0,e.outerElement=this,e.addEventListener("click",function(){this.outerElement.selected=this,this.trappedClick&&this.trappedClick()},!1),e.getTitle=function(){return this.titleDiv.innerHTML},e.getTitle=e.getTitle.bind(e),e.getDescription=function(){return this.descriptionDiv.innerHTML},e.getDescription=e.getDescription.bind(e),e.getAccentText=function(){return this.accentDiv?this.accentDiv.innerHTML:void 0},e.getAccentText=e.getAccentText.bind(e),e.getImage=function(){return this.img?this.img.getAttribute("src"):void 0},e.getImage=e.getImage.bind(e)))},n.styleItem=n.styleItem.bind(n),n.appendItem=function(e){this.styleItem(e),this.appendChild(e),this.items.push(e),bb.scroller&&bb.scroller.refresh()},n.appendItem=n.appendItem.bind(n),n.refresh=function(e){if(e&&e.length&&!(0>=e.length)){var t,i,n=document.createElement("div");for(this.items=[],t=0;e.length>t;t++)i=e[t],this.styleItem(i),this.items.push(i),n.appendChild(i);this.innerHTML="",this.appendChild(n)}},n.refresh=n.refresh.bind(n),n.insertItemBefore=function(e,t){this.styleItem(e),this.insertBefore(e,t),this.items.splice(this.items.indexOf(t),0,e),bb.scroller&&bb.scroller.refresh()},n.insertItemBefore=n.insertItemBefore.bind(n),n.getItems=function(){var e,t=[];for(e=0;this.items.length>e;e++)t.push(this.items[e]);return t},n.getItems=n.getItems.bind(n),n.clear=function(){this.items=[],n.innerHTML="",bb.scroller&&bb.scroller.refresh()},n.clear=n.clear.bind(n),n.show=function(){this.style.display="block",bb.scroller&&bb.scroller.refresh()},n.show=n.show.bind(n),n.hide=function(){this.style.display="none",bb.scroller&&bb.scroller.refresh()},n.hide=n.hide.bind(n),n.remove=function(){this.parentNode.removeChild(this),bb.scroller&&bb.scroller.refresh()},n.remove=n.remove.bind(n),o=n.querySelectorAll("[data-bb-type=item], [data-bb-type=header]");var r;for(i=0;o.length>i;i++)r=o[i],n.styleItem(r),n.items.push(r)}}},_bbPlayBook_roundPanel={apply:function(e){for(var t=0;e.length>t;t++){var i=e[t];i.setAttribute("class","bb-playbook-round-panel");for(var n=i.querySelectorAll("[data-bb-type=panel-header]"),o=0;n.length>o;o++)bb.device.isHiRes?n[o].setAttribute("class","bb-hires-panel-header"):n[o].setAttribute("class","bb-lowres-panel-header");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)}}},_bbPlayBook_textInput={apply:function(e){var t,i,n;for(t=0;e.length>t;t++)i=e[t],n="",i.hasAttribute("class")&&(n=i.getAttribute("class")),i.normal=n+" bb-pb-input",i.focused=n+" bb-pb-input-focused bb-pb-input",i.setAttribute("class",i.normal),i.isFocused=!1,i.clickCount=0,i.addEventListener("focus",function(){0==this.readOnly&&(this.setAttribute("class",this.focused),this.isFocused=!0,this.clickCount=0)},!1),i.addEventListener("blur",function(){this.setAttribute("class",this.normal),this.isFocused=!1,this.removeEventListener("click",i.handleDeleteClick,!1)},!1),i.addEventListener("click",function(e){if(0==this.clickCount)return this.clickCount++,void 0;if(e.target==this&&this.isFocused){var t=!1;e.clientX>this.clientWidth-40&&0==this.readOnly&&(t=!0),t&&(this.value="")}},!1)}},_PlayBook_contextMenu={create:function(e){var t,i="1280x768-1280x720";bb.device.is1024x600?(i="1024x600",t=100):(bb.device.is1280x768||bb.device.is1280x720)&&(i="1280x768-1280x720",t=300);var n,o=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div");return o.setAttribute("class","bb-bb10-context-menu bb-bb10-context-menu-"+i+"-dark"),o.actions=[],o.hideEvents=[],o.res=i,o.threshold=t,o.visible=!1,o.overlay=document.createElement("div"),o.overlay.threshold=t,o.overlay.setAttribute("class","bb-bb10-context-menu-overlay"),o.overlay.menu=o,e.appendChild(o.overlay),o.overlay.ontouchmove=function(e){if(this.menu.peeking){var t=e.touches[0];this.startPos&&this.startPos-t.pageX>this.threshold&&(this.menu.show(this.menu.selected),this.closeMenu=!1)}},o.overlay.ontouchend=function(){this.closeMenu&&(this.menu.hide(),event.preventDefault())},o.overlay.ontouchstart=function(e){if(this.closeMenu=!0,!this.menu.peeking&&this.menu.visible)e.preventDefault();else if(!this.menu.peeking)return;var t=e.touches[0];this.startPos=t.pageX,e.preventDefault()},n=document.createElement("div"),n.setAttribute("class","bb-bb10-context-menu-item-"+i+" bb-bb10-context-menu-header-dark"),o.header=n,o.appendChild(n),r.setAttribute("class","bb-bb10-context-menu-header-title-"+i+" bb-bb10-context-menu-header-title-dark"),r.style.width=_PlayBook_contextMenu.getWidth()-20+"px",o.topTitle=r,n.appendChild(r),s.setAttribute("class","bb-bb10-context-menu-header-description-"+i),s.style.width=_PlayBook_contextMenu.getWidth()-20+"px",o.description=s,n.appendChild(s),o.scrollContainer=document.createElement("div"),o.scrollContainer.setAttribute("class","bb-bb10-context-menu-scroller"),o.appendChild(o.scrollContainer),o.style.left=_PlayBook_contextMenu.getLeft(),o.show=function(e){e?(this.header.style.display="",this.header.style.visibility="",e.title&&(this.topTitle.innerHTML=e.title),e.description&&(this.description.innerHTML=e.description),this.selected=e,o.scrollContainer.style.top=bb.device.isPlayBook?"64px":"130px"):(this.header.style.display="none",this.selected=void 0,o.scrollContainer.style.top="0px"),o.scrollContainer.style["overflow-y"]="scroll",o.scrollContainer.style["overflow-x"]="hidden",o.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)},o.show=o.show.bind(o),o.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,o.scrollContainer.style["overflow-y"]="",o.scrollContainer.style["overflow-x"]="",o.scrollContainer.style["-webkit-overflow-scrolling"]="";for(var e=o.hideEvents.length-1;e>=0;e--)o.hideEvents[e](),o.hideEvents.pop();if(bb.device.isPlayBook)for(var e=0;this.actions.length>e;e++)this.actions[e].ontouchend();bb.device.isPlayBook?blackberry.app.event.onSwipeDown(bb.menuBar.showMenuBar):blackberry.event.addEventListener("swipedown",bb.menuBar.showMenuBar)},o.hide=o.hide.bind(o),o.peek=function(e){e?(this.header.style.display="",e.title&&(this.topTitle.innerHTML=e.title),e.description&&(this.description.innerHTML=e.description),this.selected=e,o.scrollContainer.style.top=bb.device.isPlayBook?"64px":"130px"):o.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(e){(e.target==this||e.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)},o.peek=o.peek.bind(o),o.clearWWcontextMenu=function(){},o.clearWWcontextMenu=o.clearWWcontextMenu.bind(o),o.touchHandler=function(e){if(this.peeking){var t=e.touches[0];this.startPos=t.pageX,e.target==this.scrollContainer||e.target.parentNode==this.scrollContainer&&e.target!=this.header&&(e.preventDefault(),e.stopPropagation())}},o.touchHandler=o.touchHandler.bind(o),o.touchMoveHandler=function(e){if(this.peeking){var t=e.touches[0];this.startPos&&this.startPos-t.pageX>this.threshold&&this.show(this.selected)}},o.touchMoveHandler=o.touchMoveHandler.bind(o),o.onclick=function(e){this.peeking&&(this.show(this.selected),e.stopPropagation())},o.centerMenuItems=function(){var e,t,i=bb.innerHeight(),n=bb.device.isPlayBook?53:111,o=0,r=void 0==this.actionBar?n:0;for(t=0;this.actions.length>t;t++)1==this.actions[t].visible&&o++;o=this.pinnedAction?o-1:o,e=i-Math.floor(i/2)-Math.floor(o*n/2)-r,0>e&&(e=0),this.scrollContainer.style["padding-top"]=e+"px"},o.centerMenuItems=o.centerMenuItems.bind(o),o.orientationChanged=function(){this.style["-webkit-transition"]="",this.style.left=bb.innerWidth()+"px",this.style.height=bb.innerHeight()+"px",this.centerMenuItems()},o.orientationChanged=o.orientationChanged.bind(o),window.addEventListener("orientationchange",o.orientationChanged,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:o.orientationChanged}),o.addEventListener("webkitTransitionEnd",function(){this.visible||(this.style.visibility="hidden")}),o.add=function(e){var t,i,n=e.innerHTML,o=!1;t="bb-bb10-context-menu-item-"+this.res+" bb-bb10-context-menu-item-"+this.res+"-dark",e.hasAttribute("data-bb-visible")&&"false"==e.getAttribute("data-bb-visible").toLowerCase()?(e.visible=!1,e.style.display="none"):(e.visible=!0,this.actions.push(e)),o=e.hasAttribute("data-bb-pin")&&"true"==e.getAttribute("data-bb-pin").toLowerCase(),o&&!this.pinnedAction?(t=t+" bb-bb10-context-menu-item-first-"+this.res+"-dark",e.style.bottom="-2px",e.style.position="absolute",e.style.width="100%",this.pinnedAction=e,this.appendChild(e),this.scrollContainer.style.bottom=bb.device.isPlayBook?"64px":"130px"):this.scrollContainer.appendChild(e),1==this.actions.length&&(t=t+" bb-bb10-context-menu-item-first-"+this.res+"-dark"),i=t+" bb-bb10-context-menu-item-hover-"+this.res,e.normal=t,e.highlight=i,e.innerHTML="";var r=document.createElement("div"),s=document.createElement("img");s.setAttribute("src",e.getAttribute("data-bb-img")),s.setAttribute("class","bb-bb10-context-menu-item-image-"+this.res),e.img=s,e.appendChild(s),r.setAttribute("class","bb-bb10-context-menu-item-inner-"+this.res),e.appendChild(r),r.innerHTML=n,e.display=r,e.menu=this,e.setAttribute("class",t),e.ontouchstart=function(e){if(this.menu.peeking?this.style["border-left-color"]=bb.options.highlightColor:this.style["background-color"]=bb.options.highlightColor,e.stopPropagation(),bb.device.isPlayBook){var t,i;for(i=0;this.menu.actions.length>i;i++)t=this.menu.actions[i],t!=this&&t.ontouchend()}},e.ontouchend=function(){this.menu.peeking?this.style["border-left-color"]="transparent":this.style["background-color"]=""},e.addEventListener("click",this.hide,!1),e.setCaption=function(e){this.display.innerHTML=e},e.setCaption=e.setCaption.bind(e),e.setImage=function(e){this.img.setAttribute("src",e)},e.setImage=e.setImage.bind(e),e.hide=function(){if(this.visible){this.visible=!1;var e=this.menu.actions.indexOf(this);this.menu.actions.splice(e,1),this.style.display="none",this.menu.centerMenuItems()}},e.hide=e.hide.bind(e),e.show=function(){this.visible||(this.visible=!0,this.menu.actions.push(this),this.style.display="",this.menu.centerMenuItems())},e.show=e.show.bind(e)},o.add=o.add.bind(o),o},getWidth:function(){return bb.device.isPlayBook?"300":"563"},getPeekWidth:function(){return bb.device.isPlayBook?"55px":"121px"},getLeft:function(){return window.innerWidth+3+"px"}},bb.actionBar={apply:function(e,t){var i,n,o,r,s,l,a,b=e.querySelectorAll("[data-bb-type=action]"),d=[],c=[],h=[],u=[],p=e,m="1280x768-1280x720",g=bb.getOrientation();for(bb.device.is1024x600?m="1024x600":bb.device.is1280x768||bb.device.is1280x720?m="1280x768-1280x720":bb.device.is720x720&&(m="720x720"),e.res=m,e.isVisible=!0,e.setAttribute("class","bb-bb10-action-bar-"+m+" bb-bb10-action-bar-"+g+"-"+m+" bb-bb10-action-bar-dark"),e.mainBarTabs=h,e.mainBarButtons=d,e.overflowButtons=c,e.overflowTabs=u,a=0;b.length>a;a++)i=b[a],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(e.hasAttribute("data-bb-back-caption")&&0==e.querySelectorAll("[data-bb-style=tab]").length){var v,y,f,w;s=document.createElement("div"),s.setAttribute("class","bb-bb10-action-bar-back-button-"+m+" bb-bb10-action-bar-back-button-"+m+"-dark bb-bb10-action-bar-back-button-"+g+"-"+m),s.onclick=function(){window.setTimeout(bb.popScreen,0)},e.backBtn=s,v=document.createElement("div"),v.setAttribute("class","bb-bb10-action-bar-back-chevron-"+m+"-dark"),s.appendChild(v),y=document.createElement("div"),y.setAttribute("class","bb-bb10-action-bar-back-text-"+m+" bb-bb10-action-bar-back-text-"+g+"-"+m),y.innerHTML=e.getAttribute("data-bb-back-caption"),s.backCaption=y,s.appendChild(y),w=document.createElement("div"),w.setAttribute("class","bb-bb10-action-bar-back-button-highlight"),w.style.position="absolute",w.style.width=bb.device.is1024x600?"4px":"8px",w.style["background-color"]="transparent",s.updateHighlightDimensions=function(e){bb.device.is1024x600?(w.style.height="portrait"==e?"57px":"57px",w.style.top="8px"):bb.device.is1280x768||bb.device.is1280x720?(w.style.height="portrait"==e?"110px":"70px",w.style.top="15px"):bb.device.is720x720?(w.style.height="78px",w.style.top="15px"):(w.style.height="portrait"==e?"110px":"110px",w.style.top="15px")},s.updateHighlightDimensions=s.updateHighlightDimensions.bind(s),s.backHighlight=w,s.updateHighlightDimensions(g),s.appendChild(w),s.ontouchstart=function(){this.backHighlight.style["background-color"]=bb.options.highlightColor},s.ontouchend=function(){this.backHighlight.style["background-color"]="transparent"},f=document.createElement("div"),f.setAttribute("class","bb-bb10-action-bar-back-slash-"+m+"-dark bb-bb10-action-bar-back-slash-"+g+"-"+m),s.backslash=f;var E=document.createElement("table"),x=document.createElement("tr"),k=document.createElement("td");for(e.appendChild(E),E.appendChild(x),E.setAttribute("class","bb-bb10-action-bar-table"),k.style.width=bb.device.is1024x600?bb.actionBar.getBackBtnWidth(s)-16+"px":bb.actionBar.getBackBtnWidth(s)-33+"px",x.appendChild(k),s.innerChevron=k,k.appendChild(s),k=document.createElement("td"),k.style.width=bb.device.is1024x600?"16px":"33px",f.style["background-color"]=bb.options.shades.darkOutline,x.appendChild(k),k.appendChild(f),k=document.createElement("td"),k.style.width="100%",x.appendChild(k),p=k,a=0;b.length>a;a++)i=b[a],k.appendChild(i)}if(u.length>0&&(e.tabOverflowMenu=bb.tabOverflow.create(t),e.tabOverflowMenu.actionBar=e,i=document.createElement("div"),i.actionBar=e,i.tabOverflowMenu=e.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()},e.tabOverflowBtn=i,p.insertBefore(i,p.firstChild)),c.length>0&&(e.menu=bb.actionOverflow.create(t),e.appendChild(e.menu),i=document.createElement("div"),i.menu=e.menu,i.menu.actionBar=e,i.setAttribute("data-bb-type","action"),i.setAttribute("data-bb-style","button"),i.setAttribute("data-bb-img","overflow"),i.onclick=function(){this.menu.show()},e.actionOverflowBtn=i,p.appendChild(i)),e.getUsableWidth=function(){return bb.innerWidth()-bb.actionBar.getBackBtnWidth(this.backBtn)-bb.actionBar.getActionOverflowBtnWidth(this.actionOverflowBtn)-bb.actionBar.getTabOverflowBtnWidth(this.tabOverflowBtn)},e.getUsableWidth=e.getUsableWidth.bind(e),e.switchOrientationCSS=function(e){if(e){var t=bb.getOrientation();e="portrait"==t?e.replace("landscape","portrait"):e.replace("portrait","landscape")}return e},e.switchOrientationCSS=e.switchOrientationCSS.bind(e),e.reLayoutActionBar=function(){var e,t,i,n,o="button",r=0,s=5,l=0,a=0,b=0,d=bb.getOrientation();for(this.actionOverflowBtn&&s--,this.backBtn&&s--,this.tabOverflowBtn&&s--,e=0;this.mainBarTabs.length>e&&l!=s;e++)i=this.mainBarTabs[e],1==i.visible&&l++;for(e=0;this.mainBarButtons.length>e&&l!=s;e++)t=this.mainBarButtons[e],1==t.visible&&l++;for(l=0==l?1:l,r=Math.floor(this.getUsableWidth()/l),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),this.backBtn.updateHighlightDimensions(d),n=this.backBtn.backCaption.getAttribute("class"),n=this.switchOrientationCSS(n),this.backBtn.backCaption.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.actionBar.getBackBtnWidth(this.backBtn)-16+"px":bb.actionBar.getBackBtnWidth(this.backBtn)-33+"px"),l=0,b=r-2,e=0;this.mainBarTabs.length>e;e++)i=this.mainBarTabs[e],s>l&&1==i.visible?(a+=b,i.style.width=b+"px",i.normal=this.switchOrientationCSS(i.normal),i.highlight=this.switchOrientationCSS(i.highlight),n=i.getAttribute("class"),n=this.switchOrientationCSS(n),i.setAttribute("class",n),n=i.display.getAttribute("class"),n=this.switchOrientationCSS(n),i.display.setAttribute("class",n),o="tab",l++):(i.style.display="none",i.visible=!1);for(b=r-1,e=0;this.mainBarButtons.length>e;e++)t=this.mainBarButtons[e],s>l&&1==t.visible?(a+=b,t.style.width=b+"px",t.highlight.style.width=.6*r+"px",t.highlight.style["margin-left"]=.2*r+"px",t.normal="tab"==o?"bb-bb10-action-bar-action-"+t.res+" bb-bb10-action-bar-action-"+d+"-"+t.res+" bb-bb10-action-bar-button-dark bb-bb10-action-bar-button-tab-left-"+t.res+"-dark":"bb-bb10-action-bar-action-"+t.res+" bb-bb10-action-bar-action-"+d+"-"+t.res+" bb-bb10-action-bar-button-dark",t.setAttribute("class",t.normal),t.normal=this.switchOrientationCSS(t.normal),n=t.getAttribute("class"),n=this.switchOrientationCSS(n),t.setAttribute("class",n),o="button",l++):(t.style.display="none",t.visible=!1);this.actionOverflowBtn&&(this.actionOverflowBtn.normal="tab"==o?"bb-bb10-action-bar-action-"+this.actionOverflowBtn.res+" bb-bb10-action-bar-action-"+d+"-"+this.actionOverflowBtn.res+" bb-bb10-action-bar-button-dark bb-bb10-action-bar-button-tab-left-"+this.actionOverflowBtn.res+"-dark":"bb-bb10-action-bar-action-"+this.actionOverflowBtn.res+" bb-bb10-action-bar-action-"+d+"-"+this.actionOverflowBtn.res+" bb-bb10-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),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)),this.tabOverflowBtn&&(this.tabOverflowBtn.style.width=bb.actionBar.getTabOverflowBtnWidth(this.tabOverflowBtn)-1+"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.tabHighlight.getAttribute("class"),n=this.switchOrientationCSS(n),this.tabOverflowBtn.tabHighlight.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))},e.reLayoutActionBar=e.reLayoutActionBar.bind(e),window.addEventListener("orientationchange",e.reLayoutActionBar,!1),bb.windowListeners.push({name:"orientationchange",eventHandler:e.reLayoutActionBar}),e.setBackCaption=function(e){this.setAttribute("data-bb-back-caption",e),y.innerHTML=e},e.setBackCaption=e.setBackCaption.bind(e),e.setSelectedTab=function(e){"tab"==e.getAttribute("data-bb-style")&&(bb.actionBar.highlightAction(e),e.onclick&&e.onclick())},e.setSelectedTab=e.setSelectedTab.bind(e),e.hide=function(){this.isVisible&&(this.style.display="none",bb.screen.currentScreen.outerScrollArea.style.bottom="0px",this.isVisible=!1,bb.scroller&&bb.scroller.refresh())},e.hide=e.hide.bind(e),e.show=function(){this.isVisible||(this.style.display="",bb.screen.currentScreen.outerScrollArea.style.bottom=bb.screen.getActionBarHeight()+"px",this.isVisible=!0,bb.scroller&&bb.scroller.refresh())},e.show=e.show.bind(e),u.length>0){var C;for(a=0;h.length>a;a++)i=h[a],"overflow"!=i.getAttribute("data-bb-img")&&(C=i.cloneNode(!0),C.visibleTab=i,C.res=m,C.actionBar=e,e.tabOverflowMenu.add(C));for(a=0;u.length>a;a++)i=u[a],i.res=m,i.actionBar=e,e.tabOverflowMenu.add(i)}for(a=0;c.length>a;a++)i=c[a],i.res=m,e.menu.add(i);var A;for(a=0;h.length>a;a++)A=h[a],A.res=m,n=A.innerHTML,A.actionBar=e,A.visible=!0,A.innerHTML="",A.normal="bb-bb10-action-bar-action-"+m+" bb-bb10-action-bar-action-"+g+"-"+m+" bb-bb10-action-bar-tab-dark bb-bb10-action-bar-tab-normal-dark",A.highlight=A.normal+" bb-bb10-action-bar-tab-selected-dark",A.setAttribute("class",A.normal),A.visible=!0,A.hasAttribute("data-bb-visible")&&"false"==A.getAttribute("data-bb-visible").toLowerCase()&&(A.visible=!1),l=document.createElement("img"),l.setAttribute("class","bb-bb10-action-bar-icon-"+m),l.setAttribute("src",A.getAttribute("data-bb-img")),A.icon=l,A.appendChild(l),o=document.createElement("div"),o.setAttribute("class","bb-bb10-action-bar-action-display-"+m+" bb-bb10-action-bar-action-display-"+g+"-"+m),o.innerHTML=n,A.display=o,A.appendChild(o),A.hasAttribute("data-bb-selected")&&"true"==A.getAttribute("data-bb-selected").toLowerCase()&&bb.actionBar.highlightAction(A),A.addEventListener("click",function(){bb.actionBar.highlightAction(this)},!1),A.setCaption=function(e){if(this.display.innerHTML=e,this.actionBar.tabOverflowMenu){var t,i,n=this.actionBar.tabOverflowMenu.actions;for(t=0;n.length>t;t++)i=n[t],i.visibleTab==this&&i.setCaption(e)}},A.setCaption=A.setCaption.bind(A),A.getCaption=function(){return this.display.innerHTML},A.getCaption=A.getCaption.bind(A),A.setImage=function(e){if(this.icon.setAttribute("src",e),this.actionBar.tabOverflowMenu){var t,i,n=this.actionBar.tabOverflowMenu.actions;for(t=0;n.length>t;t++)i=n[t],i.visibleTab==this&&i.setImage(e)}},A.setImage=A.setImage.bind(A),A.getImage=function(){return this.icon.getAttribute("src")},A.getImage=A.getImage.bind(A),A.hide=bb.actionBar.actionHide,A.hide=A.hide.bind(A),A.show=bb.actionBar.actionShow,A.show=A.show.bind(A);var B;e.tabOverflowBtn&&(B=e.tabOverflowBtn,B.res=m,n=B.innerHTML,B.actionBar=e,B.visible=!0,B.innerHTML="",B.normal="bb-bb10-action-bar-action-"+m+" bb-bb10-action-bar-action-"+g+"-"+m+" bb-bb10-action-bar-tab-dark bb-bb10-action-bar-tab-normal-dark",B.highlight=B.normal+" bb-bb10-action-bar-tab-selected-dark",B.setAttribute("class",B.normal),l=document.createElement("img"),l.setAttribute("class","bb-bb10-action-bar-icon-"+m),l.setAttribute("src",bb.transparentPixel),l.normal="bb-bb10-action-bar-icon-"+m+" bb-bb10-action-bar-tab-overflow-"+m+"-dark bb-bb10-action-bar-tab-overflow-"+g+"-"+m,l.highlight="bb-bb10-action-bar-icon-"+m,l.setAttribute("class",l.normal),B.appendChild(l),o=document.createElement("div"),o.setAttribute("class","bb-bb10-action-bar-action-display-"+m+" bb-bb10-action-bar-action-display-"+g+"-"+m),o.innerHTML=n,B.display=o,B.appendChild(o),B.icon=l,o.innerHTML=" ",B.display=o,B.tabHighlight=document.createElement("div"),B.tabHighlight.setAttribute("class","bb-bb10-action-bar-tab-overflow-"+m+"-dark bb-bb10-action-bar-tab-overflow-highlight-"+m+" bb-bb10-action-bar-tab-overflow-highlight-"+g+"-"+m),B.appendChild(B.tabHighlight),B.style.width=bb.actionBar.getTabOverflowBtnWidth(B)-1+"px",B.reset=function(){this.icon.setAttribute("src",bb.transparentPixel),this.icon.setAttribute("class",this.icon.normal),this.tabHighlight.style.display="none",this.display.innerHTML=" "},B.reset=B.reset.bind(B));var S;for(a=0;d.length>a;a++)S=d[a],S.res=m,S.actionBar=e,n=S.innerHTML,l=document.createElement("img"),l.setAttribute("src",S.getAttribute("data-bb-img")),l.setAttribute("class","bb-bb10-action-bar-icon-"+m),S.normal="bb-bb10-action-bar-action-"+m+" bb-bb10-action-bar-action-"+g+"-"+m+" bb-bb10-action-bar-button-dark",S.visible=!0,S.hasAttribute("data-bb-visible")&&"false"==S.getAttribute("data-bb-visible").toLowerCase()&&(S.visible=!1),S.icon=l,S.innerHTML="",S.setAttribute("class",S.normal),S.appendChild(l),o=document.createElement("div"),o.setAttribute("class","bb-bb10-action-bar-action-display-"+m),o.innerHTML=n,S.display=o,S.appendChild(o),S.highlight=document.createElement("div"),S.highlight.setAttribute("class","bb-bb10-action-bar-action-highlight"),S.highlight.style.height=bb.device.is1024x600?"4px":"8px",S.highlight.style["background-color"]="transparent",S.appendChild(S.highlight),S.setCaption=function(e){this.display.innerHTML=e},S.setCaption=S.setCaption.bind(S),S.getCaption=function(){return this.display.innerHTML},S.getCaption=S.getCaption.bind(S),S.setImage=function(e){this.icon.setAttribute("src",e)},S.setImage=S.setImage.bind(S),S.getImage=function(){return this.icon.getAttribute("src")},S.getImage=S.getImage.bind(S),S.hide=bb.actionBar.actionHide,S.hide=S.hide.bind(S),S.show=bb.actionBar.actionShow,S.show=S.show.bind(S),S.ontouchstart=function(){this.highlight.style["background-color"]=bb.options.highlightColor},S.ontouchend=function(){this.highlight.style["background-color"]="transparent"};if(e.actionOverflowBtn){actionOverflow=e.actionOverflowBtn,actionOverflow.res=m,actionOverflow.actionBar=e,actionOverflow.visible=!0,n=actionOverflow.innerHTML,l=document.createElement("img"),l.setAttribute("src",bb.transparentPixel),l.setAttribute("class","bb-bb10-action-bar-icon-"+m+" bb-bb10-action-bar-overflow-button-"+m+"-dark bb-bb10-action-bar-overflow-button-"+g+"-"+m),actionOverflow.icon=l,actionOverflow.normal="bb-bb10-action-bar-action-"+m+" bb-bb10-action-bar-action-"+g+"-"+m+" bb-bb10-action-bar-button-dark",actionOverflow.innerHTML="",actionOverflow.setAttribute("class",actionOverflow.normal),actionOverflow.appendChild(l);
var o=document.createElement("div");o.setAttribute("class","bb-bb10-action-bar-action-display-"+m),o.innerHTML=n,actionOverflow.display=o,actionOverflow.appendChild(o),actionOverflow.highlight=document.createElement("div"),actionOverflow.highlight.setAttribute("class","bb-bb10-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},actionOverflow.ontouchend=function(){this.highlight.style["background-color"]="transparent"}}e.menu&&e.menu.centerMenuItems(),e.tabOverflowMenu&&(e.tabOverflowMenu.centerMenuItems(),e.tabOverflowMenu.initSelected()),e.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(e){return e?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is1280x768||bb.device.is1280x720?"portrait"==bb.getOrientation()?154:256:bb.device.is720x720?144:"portrait"==bb.getOrientation()?154:256:0},getActionOverflowBtnWidth:function(e){return e?bb.device.is1024x600?"portrait"==bb.getOrientation()?77:123:bb.device.is1280x768||bb.device.is1280x720?"portrait"==bb.getOrientation()?154:256:bb.device.is720x720?144:"portrait"==bb.getOrientation()?154:256:0},getBackBtnWidth:function(e){return e?bb.device.is1024x600?"portrait"==bb.getOrientation()?93:150:bb.device.is1280x768||bb.device.is1280x720?"portrait"==bb.getOrientation()?187:300:bb.device.is720x720?174:"portrait"==bb.getOrientation()?187:300:0},highlightAction:function(e,t){var i,n,o=e.actionBar.mainBarTabs;for(i=0;o.length>i;i++)n=o[i],n!=e&&bb.actionBar.unhighlightAction(n);if(e.actionBar.tabOverflowMenu){for(o=e.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n!=t&&bb.actionBar.unhighlightAction(n);e.actionBar.tabOverflowBtn.style["border-top-color"]="",e.actionBar.tabOverflowBtn.setAttribute("class",e.actionBar.tabOverflowBtn.normal)}if(e.style["border-top-color"]=bb.options.highlightColor,e.setAttribute("class",e.highlight),t&&t.setAttribute("class",t.normal+" bb10Highlight"),e.actionBar.tabOverflowMenu&&!t)if(e.actionBar.tabOverflowBtn&&e==e.actionBar.tabOverflowBtn)t.setAttribute("class",t.normal+" bb10Highlight");else for(o=e.actionBar.tabOverflowMenu.actions,i=0;o.length>i;i++)n=o[i],n.visibleTab==e&&n.setAttribute("class",n.normal+" bb10Highlight");e.actionBar.tabOverflowBtn&&e.actionBar.tabOverflowBtn.reset&&e.actionBar.tabOverflowBtn.reset()},unhighlightAction:function(e){var t;if(e.style["border-top-color"]="",e.setAttribute("class",e.normal),e.actionBar&&e.actionBar.tabOverflowMenu)for(tabs=e.actionBar.tabOverflowMenu.actions,i=0;tabs.length>i;i++)t=tabs[i],t.setAttribute("class",t.normal)}},_bb_bbmBubble={apply:function(e){for(var t=0;e.length>t;t++)bb.bbmBubble.style(e[t])},style:function(e){if(e.hasAttribute("data-bb-style")){var t,i=e.getAttribute("data-bb-style").toLowerCase();"left"==i?e.setAttribute("class","bb-bbm-bubble-left"):e.setAttribute("class","bb-bbm-bubble-right");var n=e.querySelectorAll("[data-bb-type=item]");for(t=0;t>n.length;t++)e.removeChild(n[t]);var o=document.createElement("div");o.setAttribute("class","top-left image"),e.appendChild(o),o=document.createElement("div"),o.setAttribute("class","top-right image"),e.appendChild(o),o=document.createElement("div"),o.setAttribute("class","inside"),e.appendChild(o);var r=document.createElement("div");for(r.setAttribute("class","nogap"),o.appendChild(r),o=document.createElement("div"),o.setAttribute("class","bottom-left image"),e.appendChild(o),o=document.createElement("div"),o.setAttribute("class","bottom-right image"),e.appendChild(o),t=0;n.length>t;t++){var s=n[t],l=s.innerHTML;s.innerHTML='<img src="'+s.getAttribute("data-bb-img")+'" />\n'+'<div class="details">'+l+"</div>\n",r.appendChild(s)}}return e.getStyle=function(){return this.getAttribute("data-bb-style")},e.getStyle=e.getStyle.bind(e),e.setStyle=function(e){"left"==e?(this.setAttribute("data-bb-style",e),this.setAttribute("class","bb-bbm-bubble-left")):"right"==e&&(this.setAttribute("data-bb-style",e),this.setAttribute("class","bb-bbm-bubble-right")),bb.refresh()},e.setStyle=e.setStyle.bind(e),e.show=function(){this.style.display="block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.parentNode.removeChild(this),bb.refresh()},e.remove=e.remove.bind(e),e}},function(){var e=Math,t=function(e){return e>>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),l="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,a="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(e){return setTimeout(e,1)}}(),h=function(){return window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout}(),u="onorientationchange"in window?"orientationchange":"resize",p=a?"touchstart":"mousedown",m=a?"touchmove":"mousemove",g=a?"touchend":"mouseup",v=a?"touchcancel":"mouseup",y="Moz"==i?"DOMMouseScroll":"mousewheel",f="translate"+(l?"3d(":"("),w=l?",0)":")",E=function(e,t){var r,s=this,c=document;s.wrapper="object"==typeof e?e:c.getElementById(e),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&&l,scrollbarClass:"",zoom:!1,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:!1,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(e){e.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null};for(r in t)s.options[r]=t[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&&(f="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"]=f+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),a||(s._bind("mouseout",s.wrapper),"none"!=s.options.wheelAction&&s._bind(y)),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(e){var t=this;switch(e.type){case p:if(!a&&0!==e.button)return;t._start(e);break;case m:t._move(e);break;case g:case v:t._end(e);break;case u:t._resize();break;case y:t._wheel(e);break;case"mouseout":t._mouseout(e);break;case"webkitTransitionEnd":t._transitionEnd(e)}},_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:"+f+"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=e.max(t(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=e.max(t(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 e=this;setTimeout(function(){e.refresh()},n?200:0)},_pos:function(e,n){e=this.hScroll?e:0,n=this.vScroll?n:0,this.options.useTransform?this.scroller.style[i+"Transform"]=f+e+"px,"+n+"px"+w+" scale("+this.scale+")":(e=t(e),n=t(n),this.scroller.style.left=e+"px",this.scroller.style.top=n+"px"),this.x=e,this.y=n,this._scrollbarPos("h"),this._scrollbarPos("v")},_scrollbarPos:function(e,n){var o,r=this,s="h"==e?r.x:r.y;r[e+"Scrollbar"]&&(s=r[e+"ScrollbarProp"]*s,0>s?(r.options.fixedScrollbar||(o=r[e+"ScrollbarIndicatorSize"]+t(3*s),8>o&&(o=8),r[e+"ScrollbarIndicator"].style["h"==e?"width":"height"]=o+"px"),s=0):s>r[e+"ScrollbarMaxScroll"]&&(r.options.fixedScrollbar?s=r[e+"ScrollbarMaxScroll"]:(o=r[e+"ScrollbarIndicatorSize"]-t(3*(s-r[e+"ScrollbarMaxScroll"])),8>o&&(o=8),r[e+"ScrollbarIndicator"].style["h"==e?"width":"height"]=o+"px",s=r[e+"ScrollbarMaxScroll"]+(r[e+"ScrollbarIndicatorSize"]-o))),r[e+"ScrollbarWrapper"].style[i+"TransitionDelay"]="0",r[e+"ScrollbarWrapper"].style.opacity=n&&r.options.hideScrollbar?"0":"1",r[e+"ScrollbarIndicator"].style[i+"Transform"]=f+("h"==e?s+"px,0":"0,"+s+"px")+w)},_start:function(t){var n,o,r,s,l,b=this,d=a?t.touches[0]:t;b.enabled&&(b.options.onBeforeScrollStart&&b.options.onBeforeScrollStart.call(b,t),(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&&a&&t.touches.length>1&&(s=e.abs(t.touches[0].pageX-t.touches[1].pageX),l=e.abs(t.touches[0].pageY-t.touches[1].pageY),b.touchesDistStart=e.sqrt(s*s+l*l),b.originX=e.abs(t.touches[0].pageX+t.touches[1].pageX-2*b.wrapperOffsetLeft)/2-b.x,b.originY=e.abs(t.touches[0].pageY+t.touches[1].pageY-2*b.wrapperOffsetTop)/2-b.y,b.options.onZoomStart&&b.options.onZoomStart.call(b,t)),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=t.timeStamp||Date.now(),b.options.onScrollStart&&b.options.onScrollStart.call(b,t),b._bind(m),b._bind(g),b._bind(v))},_move:function(t){var n,o,r,s=this,l=a?t.touches[0]:t,b=l.pageX-s.pointX,d=l.pageY-s.pointY,c=s.x+b,h=s.y+d,u=t.timeStamp||Date.now();return s.options.onBeforeScrollMove&&s.options.onBeforeScrollMove.call(s,t),s.options.zoom&&a&&t.touches.length>1?(n=e.abs(t.touches[0].pageX-t.touches[1].pageX),o=e.abs(t.touches[0].pageY-t.touches[1].pageY),s.touchesDist=e.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"]=f+c+"px,"+h+"px"+w+" scale("+r+")",s.options.onZoom&&s.options.onZoom.call(s,t),void 0):(s.pointX=l.pageX,s.pointY=l.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=e.abs(s.distX),s.absDistY=e.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,t)),void 0)},_end:function(n){if(!a||0==n.touches.length){var o,r,s,l,b,d,c,h=this,u=a?n.changedTouches[0]:n,p={dist:0,time:0},y={dist:0,time:0},E=(n.timeStamp||Date.now())-h.startTime,x=h.x,k=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"]=f+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 a&&(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,y=k?h._momentum(k-h.startY,E,-h.y,0>h.maxScrollY?h.scrollerH-h.wrapperH+h.y-h.minScrollY:0,h.options.bounce?h.wrapperH:0):y,x=h.x+p.dist,k=h.y+y.dist,(h.x>0&&x>0||h.x<h.maxScrollX&&h.maxScrollX>x)&&(p={dist:0,time:0}),(h.y>h.minScrollY&&k>h.minScrollY||h.y<h.maxScrollY&&h.maxScrollY>k)&&(y={dist:0,time:0})),p.dist||y.dist)return b=e.max(e.max(p.time,y.time),10),h.options.snap&&(s=x-h.absStartX,l=k-h.absStartY,e.abs(s)<h.options.snapThreshold&&e.abs(l)<h.options.snapThreshold?h.scrollTo(h.absStartX,h.absStartY,200):(d=h._snap(x,k),x=d.x,k=d.y,b=e.max(d.time,b))),h.scrollTo(t(x),t(k),b),h.options.onTouchEnd&&h.options.onTouchEnd.call(h,n),void 0;if(h.options.snap)return s=x-h.absStartX,l=k-h.absStartY,e.abs(s)<h.options.snapThreshold&&e.abs(l)<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(e){var t=this,n=t.x>=0?0:t.x<t.maxScrollX?t.maxScrollX:t.x,o=t.y>=t.minScrollY||t.maxScrollY>0?t.minScrollY:t.y<t.maxScrollY?t.maxScrollY:t.y;return n==t.x&&o==t.y?(t.moved&&(t.moved=!1,t.options.onScrollEnd&&t.options.onScrollEnd.call(t)),t.hScrollbar&&t.options.hideScrollbar&&("webkit"==i&&(t.hScrollbarWrapper.style[i+"TransitionDelay"]="300ms"),t.hScrollbarWrapper.style.opacity="0"),t.vScrollbar&&t.options.hideScrollbar&&("webkit"==i&&(t.vScrollbarWrapper.style[i+"TransitionDelay"]="300ms"),t.vScrollbarWrapper.style.opacity="0"),void 0):(t.scrollTo(n,o,e||0),void 0)},_wheel:function(e){var t,i,n,o,r,s=this;if("wheelDeltaX"in e)t=e.wheelDeltaX/12,i=e.wheelDeltaY/12;else if("wheelDelta"in e)t=i=e.wheelDelta/12;else{if(!("detail"in e))return;t=i=3*-e.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,e),s.wheelZoomCount++,s.zoom(e.pageX,e.pageY,r,400),setTimeout(function(){s.wheelZoomCount--,!s.wheelZoomCount&&s.options.onZoomEnd&&s.options.onZoomEnd.call(s,e)},400)),void 0):(n=s.x+t,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(e){var t=e.relatedTarget;if(!t)return this._end(e),void 0;for(;t=t.parentNode;)if(t==this.wrapper)return;this._end(e)},_transitionEnd:function(e){var t=this;e.target==t.scroller&&(t._unbind("webkitTransitionEnd"),t._startAni())},_startAni:function(){var t,i,n,o=this,r=o.x,s=o.y,l=Date.now();if(!o.animating){if(!o.steps.length)return o._resetPos(400),void 0;if(t=o.steps.shift(),t.x==r&&t.y==s&&(t.time=0),o.animating=!0,o.moved=!0,o.options.useTransition)return o._transitionTime(t.time),o._pos(t.x,t.y),o.animating=!1,t.time?o._bind("webkitTransitionEnd"):o._resetPos(0),void 0;n=function(){var a,b,d=Date.now();return d>=l+t.time?(o._pos(t.x,t.y),o.animating=!1,o.options.onAnimationEnd&&o.options.onAnimationEnd.call(o),o._startAni(),void 0):(d=(d-l)/t.time-1,i=e.sqrt(1-d*d),a=(t.x-r)*i+r,b=(t.y-s)*i+s,o._pos(a,b),o.animating&&(o.aniTime=c(n)),void 0)},n()}},_transitionTime:function(e){e+="ms",this.scroller.style[i+"TransitionDuration"]=e,this.hScrollbar&&(this.hScrollbarIndicator.style[i+"TransitionDuration"]=e),this.vScrollbar&&(this.vScrollbarIndicator.style[i+"TransitionDuration"]=e)},_momentum:function(i,n,o,r,s){var l=6e-4,a=e.abs(i)/n,b=a*a/(2*l),d=0,c=0;return i>0&&b>o?(c=s/(6/(b/a*l)),o+=c,a=a*o/b,b=o):0>i&&b>r&&(c=s/(6/(b/a*l)),r+=c,a=a*r/b,b=r),b*=0>i?-1:1,d=a/l,{dist:b,time:t(d)}},_offset:function(e){for(var t=-e.offsetLeft,i=-e.offsetTop;e=e.offsetParent;)t-=e.offsetLeft,i-=e.offsetTop;return e!=this.wrapper&&(t*=this.scale,i*=this.scale),{left:t,top:i}},_snap:function(i,n){var o,r,s,l,a,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],a=e.abs(i-d.pagesX[d.currPageX]),a=a?500*(e.abs(d.x-i)/a):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=e.abs(n-d.pagesY[d.currPageY]),b=b?500*(e.abs(d.y-n)/b):0,d.currPageY=s,l=t(e.max(a,b))||200,{x:i,y:n,time:l}},_bind:function(e,t,i){(t||this.scroller).addEventListener(e,this,!!i)},_unbind:function(e,t,i){(t||this.scroller).removeEventListener(e,this,!!i)},destroy:function(){var e=this;e.scroller.style[i+"Transform"]="",e.hScrollbar=!1,e.vScrollbar=!1,e._scrollbar("h"),e._scrollbar("v"),e._unbind(u,window),e._unbind(p),e._unbind(m),e._unbind(g),e._unbind(v),e.options.hasTouch||(e._unbind("mouseout",e.wrapper),e._unbind(y)),e.options.useTransition&&e._unbind("webkitTransitionEnd"),e.options.checkDOMChanges&&clearInterval(e.checkDOMTime),e.options.onDestroy&&e.options.onDestroy.call(e)},refresh:function(){var e,n,o,r,s=this,l=0,a=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=t(s.scroller.offsetWidth*s.scale),s.scrollerH=t((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,e=s._offset(s.wrapper),s.wrapperOffsetLeft=-e.left,s.wrapperOffsetTop=-e.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++)l=s._offset(r[n]),l.left+=s.wrapperOffsetLeft,l.top+=s.wrapperOffsetTop,s.pagesX[n]=l.left<s.maxScrollX?s.maxScrollX:l.left*s.scale,s.pagesY[n]=l.top<s.maxScrollY?s.maxScrollY:l.top*s.scale;else if(s.options.snap){for(s.pagesX=[];l>=s.maxScrollX;)s.pagesX[a]=l,l-=s.wrapperW,a++;for(s.maxScrollX%s.wrapperW&&(s.pagesX[s.pagesX.length]=s.maxScrollX-s.pagesX[s.pagesX.length-1]+s.pagesX[s.pagesX.length-1]),l=0,a=0,s.pagesY=[];l>=s.maxScrollY;)s.pagesY[a]=l,l-=s.wrapperH,a++;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(e,t,i,n){var o,r,s=this,l=e;for(s.stop(),l.length||(l=[{x:e,y:t,time:i,relative:n}]),o=0,r=l.length;r>o;o++)l[o].relative&&(l[o].x=s.x-l[o].x,l[o].y=s.y-l[o].y),s.steps.push({x:l[o].x,y:l[o].y,time:l[o].time||0});s._startAni()},scrollToElement:function(t,i){var n,o=this;t=t.nodeType?t:o.scroller.querySelector(t),t&&(n=o._offset(t),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?e.max(2*e.abs(n.left),2*e.abs(n.top)):i,o.scrollTo(n.left,n.top,i))},scrollToPage:function(e,t,i){var n,o,r=this;i=void 0===i?400:i,r.options.onScrollStart&&r.options.onScrollStart.call(r),r.options.snap?(e="next"==e?r.currPageX+1:"prev"==e?r.currPageX-1:e,t="next"==t?r.currPageY+1:"prev"==t?r.currPageY-1:t,e=0>e?0:e>r.pagesX.length-1?r.pagesX.length-1:e,t=0>t?0:t>r.pagesY.length-1?r.pagesY.length-1:t,r.currPageX=e,r.currPageY=t,n=r.pagesX[e],o=r.pagesY[t]):(n=-r.wrapperW*e,o=-r.wrapperH*t,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(e,t,n,o){var r=this,s=n/r.scale;r.options.useTransform&&(r.zoomed=!0,o=void 0===o?200:o,e=e-r.wrapperOffsetLeft-r.x,t=t-r.wrapperOffsetTop-r.y,r.x=e-e*s+r.x,r.y=t-t*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"]=f+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,menuOpen:!1,menu:!1,screen:!1,apply:function(e,t){bb.device.isPlayBook||bb.device.isBB10?(bb.menuBar.createSwipeMenu(e,t),e.parentNode.removeChild(e),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))):window.blackberry&&blackberry.ui.menu?(bb.menuBar.createBlackberryMenu(e),e.parentNode.removeChild(e)):console.log("Unable to create Blackberry/onSwipeDown menu.")},createBlackberryMenu:function(e){var t,i,n,o;t=e.getElementsByTagName("div");for(var r=0;t.length>r;r++)o=t[r],"menu-item"===o.getAttribute("data-bb-type")?(n=o.innerHTML,n?(i=new blackberry.ui.menu.MenuItem(!1,r,n,o.onclick),blackberry.ui.menu.addMenuItem(i),o.hasAttribute("data-bb-selected")&&"true"===o.getAttribute("data-bb-selected")&&blackberry.ui.menu.setDefaultMenuItem(i)):console.log("can't add menu item without data-bb-caption")):"menu-separator"===o.getAttribute("data-bb-type")?(i=new blackberry.ui.menu.MenuItem(!0,r),blackberry.ui.menu.addMenuItem(i)):console.log("invalid menu item type")},createSwipeMenu:function(e,t){if(bb.device.isBB10){bb.menuBar.screen=t;var i,n,o,r,s,l,a,b,d,c,h=document.createElement("div"),u="1280x768-1280x720",p=5,m=!1,g=!1,v=[];if(bb.device.is1024x600?(u="1024x600",bb.menuBar.height=100):bb.device.is1280x768||bb.device.is1280x720?(u="1280x768-1280x720",bb.menuBar.height=140):bb.device.is720x720&&(u="720x720",bb.menuBar.height=110),h.setAttribute("class","bb-bb10-menu-bar-"+u+" bb-bb10-menu-bar-dark"),y=e.querySelectorAll("[data-bb-type=menu-item]"),y.length>0){for(i=0,n=y.length;y.length>i;i++)r=y[i],o=r.hasAttribute("data-bb-type")?r.getAttribute("data-bb-type").toLowerCase():void 0,"menu-item"==o?(a=r.innerHTML,l=r.getAttribute("data-bb-img"),a&&l?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=Math.floor(100/v.length),i=0,n=v.length;n>i;i++)r=v[i],a=r.innerHTML,l=r.getAttribute("data-bb-img"),c=document.createElement("div"),c.setAttribute("class","bb-bb10-menu-bar-item-"+u),r.innerHTML="",s=document.createElement("img"),s.setAttribute("src",l),c.appendChild(s),b=document.createElement("div"),b.setAttribute("class","bb-bb10-menu-bar-item-caption-"+u),b.innerHTML=a,c.appendChild(b),c.onclick=r.onclick,i==v.length-1?(c.style.width=d-1+"%",c.style.float="right"):c.style.width=d+"%",h.appendChild(c)}else h.style.display="none",bb.menuBar.menu=null;h.style["-webkit-transform"]="translate(0,0)",h.addEventListener("click",bb.menuBar.onMenuBarClicked,!1),t.appendChild(h),bb.menuBar.menu=h}else{var y,f,w,r,s,E,b,x,k=document.createElement("div");if(bb.menuBar.height=100,k.setAttribute("class","pb-menu-bar"),y=e.getElementsByTagName("div"),y.length>0)for(f=document.createElement("ul"),k.appendChild(f),w=0;y.length>w;w++)r=y[w],"menu-item"===r.getAttribute("data-bb-type")?(E=r.innerHTML,iconPath=r.getAttribute("data-bb-img"),E&&iconPath&&(x=document.createElement("li"),r.innerHTML="",s=new Image,s.src=iconPath,x.appendChild(s),b=document.createElement("div"),b.setAttribute("class","pb-menu-bar-caption"),b.innerText=E,x.appendChild(b),x.onclick=r.onclick,f.appendChild(x))):"menu-separator"===r.getAttribute("data-bb-type")?(f=document.createElement("ul"),k.appendChild(f)):console.log("invalid menu item type");k.style["-webkit-transform"]="translate(0,0)",k.addEventListener("click",bb.menuBar.onMenuBarClicked,!1),document.body.appendChild(k),bb.menuBar.menu=k}bb.screen.overlay||(bb.screen.overlay=document.createElement("div"),bb.screen.overlay.setAttribute("class","bb-bb10-menu-bar-overlay")),t.appendChild(bb.screen.overlay),bb.menuBar.menu.overlay=bb.screen.overlay},showMenuBar:function(){bb.menuBar.menuOpen||(bb.menuBar.menu.overlay.style.display="inline",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.style["-webkit-transition"]="all 0.25s ease-in-out",bb.menuBar.screen.style["-webkit-transform"]="translate(0, "+(bb.menuBar.height+3)+"px)"):bb.device.isPlayBook&&(bb.menuBar.menu.style["-webkit-transition"]="all 0.5s ease-in-out",bb.menuBar.menu.style["-webkit-transform"]="translate(0, "+(bb.menuBar.height+3)+"px)",bb.menuBar.menu.overlay.style.display="none"),bb.menuBar.menuOpen=!0,bb.menuBar.menu.overlay.addEventListener("touchstart",bb.menuBar.overlayTouchHandler,!1))},hideMenuBar:function(){bb.menuBar.menuOpen&&(bb.menuBar.menu.overlay.style.display="none",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.screen.style["-webkit-transition"]="all 0.25s ease-in-out",bb.menuBar.screen.style["-webkit-transform"]="translate(0, 0)",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"]="translate(0, -"+(bb.menuBar.height+3)+"px)"),bb.menuBar.menuOpen=!1,bb.menuBar.menu.overlay.removeEventListener("touchstart",bb.menuBar.overlayTouchHandler,!1))},overlayTouchHandler:function(e){e.preventDefault(),e.stopPropagation(),bb.menuBar.hideMenuBar()},onMenuBarClicked:function(){bb.menuBar.hideMenuBar()},clearMenu:function(){window.blackberry&&(bb.menuBar.menu&&(bb.device.isPlayBook||bb.device.isBB10)?(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.menuOpen=!1):blackberry.ui&&blackberry.ui.menu&&blackberry.ui.menu.clearMenuItems())}},_bb_progress={NORMAL:0,PAUSED:1,ERROR:2,apply:function(e){for(var t=0;e.length>t;t++)bb.progress.style(e[t],!0)},style:function(e,t){var i,n,o;return bb.device.isBB10?(i=bb.screen.controlColor,n=bb.options.highlightColor,o=bb.options.shades.darkHighlight):(i="light",n=bb.device.isPlayBook?bb.options.highlightColor:"#92B43B",o="#8FB03B"),outerElement=document.createElement("div"),outerElement.progress=e,outerElement.state=bb.progress.NORMAL,e.parentNode&&e.parentNode.insertBefore(outerElement,e),e.style.display="none",outerElement.appendChild(e),outerElement.maxValue=e.hasAttribute("max")?parseInt(e.getAttribute("max")):0,outerElement.value=e.hasAttribute("value")?parseInt(e.getAttribute("value")):0,outerElement.className="bb-progress",outerElement.outer=document.createElement("div"),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.isBB10?"bb-progress-fill bb10Highlight":"bb-progress-fill bbProgressHighlight",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),e.outerElement=outerElement,e.setValue=function(e){var t,r=0;
e&&0>e||e&&e>parseInt(this.outerElement.maxValue)||(e?(this.outerElement.value=e,this.value=e):0==e?(this.outerElement.value=0,this.value=0):e=parseInt(this.outerElement.value),e==this.outerElement.maxValue?(this.outerElement.fill.style.background="-webkit-gradient(linear, center top, center bottom, from("+o+"), to("+n+"))",r=1):0==e?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))":(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)),t=Math.floor(parseInt(window.getComputedStyle(this.outerElement.outer).width)*r),this.outerElement.fill.style.width=t+"px")},e.setValue=e.setValue.bind(e),e.setState=function(e){this.outerElement.state=e,this.setValue()},e.setState=e.setState.bind(e),e.show=function(){this.outerElement.style.display="block",bb.refresh()},e.show=e.show.bind(e),e.hide=function(){this.outerElement.style.display="none",bb.refresh()},e.hide=e.hide.bind(e),e.remove=function(){this.outerElement.parentNode.removeChild(this.outerElement),bb.refresh()},e.remove=e.remove.bind(e),e.setMax=function(e){!e||0>e||e==this.max||(this.max=e,this.outerElement.maxValue=e)},e.setMax=e.setMax.bind(e),t?(e.onbbuidomready=function(){this.setValue(),document.removeEventListener("bbuidomready",this.onbbuidomready,!1)},e.onbbuidomready=e.onbbuidomready.bind(e),document.addEventListener("bbuidomready",e.onbbuidomready,!1)):window.setTimeout(e.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(e){var t,i;bb.screen.contextMenu=null,bb.device.isBB10&&bb.device.isPlayBook?t="bb-bb10-1024x600-screen":bb.device.isBB10&&(bb.device.is1280x768||bb.device.is1280x720)?t="bb-bb10-1280x768-1280x720-screen":bb.device.isBB10&&bb.device.is720x720?t="bb-bb10-720x720-screen":bb.device.isHiRes&&(t="bb-hires-screen");for(var n=0;e.length>n;n++){if(i=e[n],bb.screen.currentScreen=i,i.setAttribute("class",t),bb.device.isBB10){var o=i.querySelectorAll("[data-bb-type=menu]");for(d=i.querySelectorAll("[data-bb-type=title]"),u=i.querySelectorAll("[data-bb-type=action-bar]"),p=i.querySelectorAll("[data-bb-type=context-menu]"),c=[],h=null,menuBarHeight=bb.screen.getMenuBarHeight(),actionBarHeight=bb.screen.getActionBarHeight(),titleBarHeight=bb.screen.getTitleBarHeight(),o.length>0?(o=o[0],i.menuBar=o):o=null,d.length>0?(d=d[0],i.titleBar=d):d=null,u.length>0?(u=u[0],i.actionBar=u):u=null,l=document.createElement("div"),i.appendChild(l),i.hasAttribute("data-bb-scroll-effect")&&"off"==i.getAttribute("data-bb-scroll-effect").toLowerCase()||(i.bbUIscrollWrapper=l),a=document.createElement("div"),l.appendChild(a),b=0;i.childNodes.length-1>b;b++)h=i.childNodes[b],h!=u&&h!=o&&h!=d&&c.push(h);for(b=0;c.length>b;b++)a.appendChild(c[b]);if(i.menuBarHeight=menuBarHeight,i.actionBarHeight=actionBarHeight,i.titleBarHeight=titleBarHeight,i.outerScrollArea=l,l.addEventListener("scroll",function(){evt=document.createEvent("Events"),evt.initEvent("bbuiscrolling",!0,!0),document.dispatchEvent(evt)},!1),i.getAttribute("data-bb-indicator")){var r=document.createElement("div"),s=document.createElement("div");l.scrollArea=a,l.overlay=r,r.style.position="absolute",r.style.bottom="0px",r.style.top="0px",r.style.left="0px",r.style.right="0px",r.touchstart=function(e){e.preventDefault(),e.stopPropagation()},r.touchend=function(e){e.preventDefault(),e.stopPropagation()},r.click=function(e){e.preventDefault(),e.stopPropagation()},l.appendChild(r),a.style.display="none",s.setAttribute("data-bb-type","activity-indicator"),s.setAttribute("data-bb-size","large"),s.style.margin=bb.device.is720x720?"30% auto 0px auto":"landscape"==bb.getOrientation().toLowerCase()?"20% auto 0px auto":"60% auto 0px auto",r.appendChild(s),l.bbuidomprocessed=function(){this.scrollArea.style.display="",this.removeChild(this.overlay),document.removeEventListener("bbuidomprocessed",this.bbuidomprocessed,!1),bb.device.isPlayBook&&bb.scroller&&bb.scroller.refresh()},l.bbuidomprocessed=l.bbuidomprocessed.bind(l),document.addEventListener("bbuidomprocessed",l.bbuidomprocessed,!1)}d&&u?(l.style.overflow="auto",l.style.position="absolute",l.style.bottom=actionBarHeight+"px",l.style.top=titleBarHeight+"px",l.style.left="0px",l.style.right="0px"):d?(l.style.overflow="auto",l.style.position="absolute",l.style.bottom="0px",l.style.top=titleBarHeight+"px",l.style.left="0px",l.style.right="0px"):u?(l.style.overflow="auto",l.style.position="absolute",l.style.bottom=actionBarHeight+"px",l.style.top="0px",l.style.left="0px",l.style.right="0px"):(l.setAttribute("style","overflow:auto;bottom:0px;position:absolute;top:0px;left:0px;right:0px;"),l.style.overflow="auto",l.style.position="absolute",l.style.bottom="0px",l.style.top="0px",l.style.left="0px",l.style.right="0px"),o&&bb.menuBar.apply(o,i),d&&bb.titleBar.apply(d),u&&bb.actionBar.apply(u,i),p.length>0?bb.screen.processContext(p[0],i):p=null}else if(bb.device.isPlayBook){var o=i.querySelectorAll("[data-bb-type=menu]");o.length>0&&(o=o[0],bb.menuBar.apply(o,i));var l,a,b,d=i.querySelectorAll("[data-bb-type=title]"),c=[],h=null,u=i.querySelectorAll("[data-bb-type=action-bar]"),p=i.querySelectorAll("[data-bb-type=context-menu]");for(b=0;u.length>b;b++)u[b].style.display="none";for(b=0;p.length>b;b++)p[b].style.display="none";for(d=d.length>0?d[0]:null,l=document.createElement("div"),i.appendChild(l),i.hasAttribute("data-bb-scroll-effect")&&"off"==i.getAttribute("data-bb-scroll-effect").toLowerCase()||(i.bbUIscrollWrapper=l),a=document.createElement("div"),l.appendChild(a),b=0;i.childNodes.length-1>b;b++)h=i.childNodes[b],h!=d&&c.push(h);for(b=0;c.length>b;b++)a.appendChild(c[b]);d?(l.style.overflow="auto",l.style.bottom="0px",l.style.position="absolute",l.style.top="55px",l.style.left="0px",l.style.right="0px",bb.titleBar.apply(d)):(l.setAttribute("style","overflow:auto;bottom:0px;position:absolute;top:0px;left:0px;right:0px;"),l.style.overflow="auto",l.style.bottom="0px",l.style.position="absolute",l.style.top="0px",l.style.left="0px",l.style.right="0px")}else{var o=i.querySelectorAll("[data-bb-type=menu]");o.length>0&&(o=o[0],bb.menuBar.apply(o,i));var d=i.querySelectorAll("[data-bb-type=title]"),u=i.querySelectorAll("[data-bb-type=action-bar]"),p=i.querySelectorAll("[data-bb-type=context-menu]");for(b=0;u.length>b;b++)u[b].style.display="none";for(b=0;p.length>b;b++)p[b].style.display="none";d.length>0&&(d=d[0],bb.titleBar.apply(d))}i.refresh=function(){bb.scroller&&bb.scroller.refresh()},i.refresh=i.refresh.bind(i),i.scrollTo=function(e,t){bb.scroller?bb.scroller.scrollTo(e,t):bb.device.isBB10&&(this.bbUIscrollWrapper.scrollTop=e)},i.scrollTo=i.scrollTo.bind(i),i.scrollToElement=function(e){if(bb.scroller)bb.scroller.scrollToElement(e);else if(bb.device.isBB10){if(!e)return;var t=0,i=e;if(i.offsetParent)do t+=i.offsetTop;while(i=i.offsetParent);bb.screen.currentScreen.titleBar&&(t-=bb.screen.currentScreen.titleBarHeight),bb.screen.currentScreen.actionBar&&(t-=bb.screen.getActionBarHeight()),this.scrollTo(t)}},i.scrollToElement=i.scrollToElement.bind(i)}},processContext:function(e,t){bb.device.isPlayBook||bb.device.isRipple||blackberry.ui&&blackberry.ui.contextmenu&&(blackberry.ui.contextmenu.enabled=!0),t.appendChild(e),e.menu=bb.contextMenu.create(t),e.appendChild(e.menu),bb.screen.contextMenu=e.menu;var i,n=e.querySelectorAll("[data-bb-type=action]");for(i=0;n.length>i;i++)e.menu.add(n[i]);e.menu.centerMenuItems()},fadeIn:function(e){var t=.3,i="ease-out",n=e.style;n["-webkit-animation-name"]="bbUI-fade-in",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},fadeOut:function(e){var t=.3,i="ease-out",n=e.style;n["-webkit-animation-name"]="bbUI-fade-out",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideLeft:function(e){var t=.3,i="ease-out",n=e.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-left",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutLeft:function(e){var t=.3,i="ease-out",n=e.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-out-left",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideRight:function(e){var t=.3,i="ease-out",n=e.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-right",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutRight:function(e){var t=.3,i="ease-out",n=e.style;n.width=bb.innerWidth()+"px",n["-webkit-animation-name"]="bbUI-slide-out-right",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideUp:function(e){var t=.3,i="ease-out",n=e.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-up",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutUp:function(e){var t=.3,i="ease-out",n=e.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-out-up",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideDown:function(e){var t=.3,i="ease-out",n=e.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-down",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},slideOutDown:function(e){var t=.3,i="ease-out",n=e.style;n.height=bb.innerHeight()+"px",n["-webkit-animation-name"]="bbUI-slide-out-down",n["-webkit-animation-duration"]=t+"s",n["-webkit-animation-timing-function"]=i,n["-webkit-transform"]="translate3d(0,0,0)",n["-webkit-backface-visibility"]="hidden"},reAdjustHeight:function(){bb.device.isBB5?document.body.style.height=screen.height-27+"px":bb.device.isBB6?document.body.style.height=screen.height-17+"px":bb.device.isBB7&&0>navigator.appVersion.indexOf("Ripple")&&(document.body.style.height=screen.height+"px")},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.is1280x720?"portrait"==bb.getOrientation().toLowerCase()?139:99:bb.device.is720x720?109:"portrait"==bb.getOrientation().toLowerCase()?139:99},getTitleBarHeight:function(){return bb.device.is1024x600?65:bb.device.is1280x768||bb.device.is1280x720?111:bb.device.is720x720?95:111}},bb.tabOverflow={create:function(e){var t,i=document.createElement("div");return i.screen=e,i.itemClicked=!1,i.visible=!1,i.actions=[],i.tabOverflowState={display:void 0,img:void 0,style:void 0,caption:void 0},i.res=bb.device.is1024x600?"1024x600":bb.device.is1280x768||bb.device.is1280x720?"1280x768-1280x720":"1280x768-1280x720",i.setAttribute("class","bb-bb10-tab-overflow-menu bb-bb10-tab-overflow-menu-dark"),e.parentNode.appendChild(i),i.style["z-index"]="-100",i.style.display="none",i.style.width=i.width+"px",bb.screen.tabOverlay||(t=document.createElement("div"),t.menu=i,bb.screen.tabOverlay=t,t.setAttribute("class","bb-bb10-tab-overflow-menu-overlay "),e.appendChild(t),t.ontouchstart=function(e){e.preventDefault(),e.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 e=this.actionBar.tabOverflowBtn;this.tabOverflowState.display=e.tabHighlight.style.display,this.tabOverflowState.img=e.icon.src,this.tabOverflowState.caption=e.display.innerHTML,this.tabOverflowState.style=e.icon.getAttribute("class"),this.screen.addEventListener("webkitTransitionEnd",i.doEndTransition),this.setDimensions(),e.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",!this.itemClicked){var e=this.actionBar.tabOverflowBtn;e.icon.setAttribute("src",this.tabOverflowState.img),e.icon.setAttribute("class",this.tabOverflowState.style),e.tabHighlight.style.display=this.tabOverflowState.display,e.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 e,t=bb.innerHeight(),i=111;bb.device.is1024x600?i=53:(bb.device.is1280x768||bb.device.is1280x720)&&(i=111),e=t-Math.floor(t/2)-Math.floor(this.actions.length*i/2)-i,0>e&&(e=0),this.actions[0].style["margin-top"]=e+"px"},i.centerMenuItems=i.centerMenuItems.bind(i),i.initSelected=function(){var e,t;for(e=0;this.actions.length>e;e++)if(t=this.actions[e],t.initialSelected){t.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(e){var t,i,n,o,r=e.innerHTML,s=e.getAttribute("data-bb-accent-text"),l=document.createElement("div"),a="bb-bb10-tab-overflow-menu-item-inner-"+this.res,b=document.createElement("img");t="bb-bb10-tab-overflow-menu-item-"+this.res+" bb-bb10-tab-overflow-menu-item-"+this.res+"-dark",this.appendChild(e),e.hasAttribute("data-bb-visible")&&"false"==e.getAttribute("data-bb-visible").toLowerCase()?(e.visible=!1,e.style.display="none"):(e.visible=!0,this.actions.push(e)),1==this.actions.length&&(t=t+" bb-bb10-tab-overflow-menu-item-first-"+this.res+"-dark"),e.normal=t,e.accentText=null,e.menu=this,e.caption=r,e.setAttribute("class",e.normal),e.innerHTML="",e.visibleTab||(e.visibleTab=e.actionBar.tabOverflowBtn),i=document.createElement("table"),n=document.createElement("tr"),i.appendChild(n),e.appendChild(i),o=document.createElement("td"),b.setAttribute("src",e.getAttribute("data-bb-img")),b.setAttribute("class","bb-bb10-tab-overflow-menu-item-image-"+this.res),e.img=b,o.appendChild(b),n.appendChild(o),o=document.createElement("td"),l.innerHTML=r,e.display=l,o.appendChild(l),s?(e.accentText=document.createElement("div"),e.accentText.innerHTML=s,e.accentText.setAttribute("class","tab-accent-text"),o.appendChild(e.accentText),a=a+" bb-bb10-tab-overflow-menu-item-double-"+this.res):a=a+" bb-bb10-tab-overflow-menu-item-single-"+this.res,l.setAttribute("class",a),n.appendChild(o),e.setOverflowTab=function(e){var t=this.actionBar.tabOverflowBtn;e&&bb.actionBar.highlightAction(this.visibleTab,this),this.visibleTab==t&&(t.icon.setAttribute("src",this.img.src),t.icon.setAttribute("class",t.icon.highlight),t.tabHighlight.style.display="block",t.display.innerHTML=this.caption)},e.setOverflowTab=e.setOverflowTab.bind(e),e.initialSelected=e.hasAttribute("data-bb-selected")&&"true"==e.getAttribute("data-bb-selected").toLowerCase(),e.oldClick=e.onclick,e.onclick=function(){var e=this.actionBar.tabOverflowBtn;this.menu.itemClicked=!0,bb.actionBar.highlightAction(this.visibleTab,this),this.visibleTab==e&&this.setOverflowTab(!1),this.oldClick&&this.oldClick()},e.setCaption=function(e){this.display.innerHTML=e},e.setCaption=e.setCaption.bind(e),e.setImage=function(e){this.img.setAttribute("src",e)},e.setImage=e.setImage.bind(e),e.show=function(){this.visible||(this.visible=!0,this.menu.actions.push(this),this.style.display="",this.menu.centerMenuItems())},e.show=e.show.bind(e),e.hide=function(){if(this.visible){this.visible=!1;var e=this.menu.actions.indexOf(this);this.menu.actions.splice(e,1),this.style.display="none",this.menu.centerMenuItems()}},e.hide=e.hide.bind(e)},i.add=i.add.bind(i),i},getWidth:function(){return bb.device.is1024x600?"portrait"==bb.getOrientation()?bb.innerWidth()-77:400:bb.device.is1280x768||bb.device.is1280x720?"portrait"==bb.getOrientation()?bb.innerWidth()-154:700:"portrait"==bb.getOrientation()?bb.innerWidth()-154:700}},bb.titleBar={apply:function(titleBar){if(bb.device.isBB10){var res="1280x768-1280x720",orientation=bb.getOrientation(),button,caption,titleBarClass,details,topTitleArea=document.createElement("div"),img,accentText;bb.device.is1024x600?res="1024x600":bb.device.is1280x768||bb.device.is1280x720?res="1280x768-1280x720":bb.device.is720x720&&(res="720x720"),titleBar.topTitleArea=topTitleArea,titleBar.appendChild(topTitleArea),titleBarClass=bb.options.coloredTitleBar?"bb-bb10-title-bar-"+res+" bb-bb10-title-bar-"+orientation+"-"+res+" bb10-title-colored":"bb-bb10-title-bar-"+res+" bb-bb10-title-bar-"+orientation+"-"+res+" bb-bb10-title-bar-"+bb.screen.controlColor,topTitleArea.setAttribute("class",titleBarClass),caption=document.createElement("div"),titleBar.caption=caption,caption.setAttribute("class","bb-bb10-title-bar-caption-"+res+" bb-bb10-title-bar-caption-"+orientation+"-"+res),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"),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),(titleBar.actionButton||titleBar.backButton)&&(titleBar.evenButtonWidths=function(){var e,t=this.backButton?parseInt(window.getComputedStyle(this.backButton).width):0,i=this.actionButton?parseInt(window.getComputedStyle(this.actionButton).width):0;this.actionButton&&this.backButton?(e=t>i?t:i,this.backButton.style.width=e+"px",this.actionButton.style.width=e+"px",this.caption.style["margin-left"]=e+24+"px",this.caption.style["margin-right"]=e+24+"px"):this.actionButton?(this.caption.style["margin-left"]="0px",this.caption.style["margin-right"]=i+24+"px"):this.backButton&&(this.caption.style["margin-right"]="0px",this.caption.style["margin-left"]=t+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-bb10-title-bar-caption-left-"+res),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),details.setAttribute("class","bb-bb10-title-bar-caption-details-img-"+res),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||bb.device.is1280x720?"70px":bb.device.is720x720?"55px":"70px",accentText=document.createElement("div"),accentText.setAttribute("class","bb-bb10-title-bar-accent-text-"+res),bb.options.coloredTitleBar&&(accentText.style.color="silver"),titleBar.accentText=accentText,accentText.innerHTML=titleBar.getAttribute("data-bb-accent-text"),details.appendChild(accentText))),titleBar.setCaption=function(e){this.caption.innerHTML=e},titleBar.setCaption=titleBar.setCaption.bind(titleBar),titleBar.getCaption=function(){return this.caption.innerHTML},titleBar.getCaption=titleBar.getCaption.bind(titleBar),titleBar.setBackCaption=function(e){this.backButton.firstChild.innerHTML=e,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(e){this.actionButton.firstChild.innerHTML=e,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)}else if(bb.device.isPlayBook){if(titleBar.setAttribute("class","pb-title-bar"),titleBar.innerHTML=titleBar.getAttribute("data-bb-caption"),titleBar.hasAttribute("data-bb-back-caption")){var button=document.createElement("div"),buttonInner=document.createElement("div");button.setAttribute("class","pb-title-bar-back"),button.onclick=bb.popScreen,buttonInner.setAttribute("class","pb-title-bar-back-inner"),buttonInner.innerHTML=titleBar.getAttribute("data-bb-back-caption"),button.appendChild(buttonInner),titleBar.appendChild(button)}}else titleBar.setCaption=function(e){return e?(this.setAttribute("data-bb-caption",e),this.innerHTML=e,void 0):(e=this.getAttribute("data-bb-caption"),this.innerHTML=e,void 0)},titleBar.setCaption=titleBar.setCaption.bind(titleBar),titleBar.getCaption=function(){return this.innerHTML},titleBar.getCaption=titleBar.getCaption.bind(titleBar),titleBar.hasAttribute("data-bb-caption")&&(bb.device.isHiRes?titleBar.setAttribute("class","bb-hires-screen-title"):titleBar.setAttribute("class","bb-lowres-screen-title"),titleBar.innerHTML=titleBar.getAttribute("data-bb-caption"))},styleBB10Button:function(e){var t,i,n,o="1280x768-1280x720",r=document.createElement("div");bb.device.is1024x600?o="1024x600":bb.device.is1280x768||bb.device.is1280x720?o="1280x768-1280x720":bb.device.is720x720&&(o="720x720"),bb.options.coloredTitleBar?(t="bb-bb10-titlebar-button bb-bb10-titlebar-button-"+o+" bb10-title-button-colored",i="bb-bb10-titlebar-button bb-bb10-titlebar-button-"+o+" bb10-title-button-colored-highlight",n="bb-bb10-titlebar-button-container-"+o+" bb10-title-button-container-colored"):(t="bb-bb10-titlebar-button bb-bb10-titlebar-button-"+o+" bb-bb10-titlebar-button-"+bb.screen.controlColor,i="bb-bb10-titlebar-button bb-bb10-titlebar-button-"+o+" bb-bb10-titlebar-button-highlight-"+bb.screen.controlColor,n="bb-bb10-titlebar-button-container-"+o+" bb-bb10-titlebar-button-container-"+bb.screen.controlColor),e.enabled=!0,r.innerHTML=e.innerHTML,e.innerHTML="",e.appendChild(r),r.setAttribute("class",t),e.setAttribute("class",n),e.outerNormal=n,e.innerElement=r,r.normal=t,r.highlight=i,e.ontouchstart=function(){this.innerElement.setAttribute("class",this.innerElement.highlight)},e.ontouchend=function(){this.innerElement.setAttribute("class",this.innerElement.normal)},e.trappedClick=e.onclick,e.onclick=void 0,null!==e.trappedClick&&e.addEventListener("click",function(){this.enabled&&this.trappedClick()},!1)}};