var dmobile=dmobile||{};dmobile.utils={};dmobile.utils.createObject=function(a){function b(){}b.prototype=a;return new b};dmobile.utils.QueryString=function(){this.params=function(a){if(a=="")return null;for(var b={},c=0;c<a.length;++c){var d=a[c].split("=");b[d[0]]=decodeURIComponent(d[1].replace(/\+/g," "))}return b}(window.location.search.substr(1).split("&"))};
dmobile.utils.applySuffixForUserAgent=function(a){a.find("img").each(function(){var a=$(this).attr("src");if(a.indexOf("-ipad.")==-1){var c=a.split(".");if(c[c.length-1].length==3){c[c.length-2]+="-ipad";var a=c.join("."),d=this;$.ajax({url:"/services/ping?path="+a,type:"GET",dataType:"json",error:function(){},success:function(c){c.ok&&$(d).attr("src",a)}})}}})};dmobile=dmobile||{};dmobile.advertisements={};dmobile.advertisements.Advertisement=function(){this.controller=null;$("body").css({display:"block"});var a=$(".ad");if(a[0]!="undefined")a.show(),this.controller=new dmobile.advertisements.AdvertisementFooter({element:a[0]})};
dmobile.advertisements.AdvertisementFooter=function(a){this.element=a.element;this.startTouchY=this.contentOffsetY=0;this.platform=dmobile.useragent.devicePlatform.Unknown;this.initializePlatformConstants();if(typeof a.updateOnScroll=="undefined")a.updateOnScroll=!0;if(a.updateOnScroll){if(typeof a.hidesOnTouch=="undefined")a.hidesOnTouch=~this.element.className.indexOf("hides-on-touch")?this.currentDevice.platform==dmobile.useragent.devicePlatform.iOS&&this.currentDevice.os.majorVersion>=5?!1:!0:
!1;a.hidesOnTouch&&this.touchEnabled()&&(document.addEventListener("touchstart",this,!1),document.addEventListener("touchend",this,!1));this.initializeScrollListener()}this.initializeAdPosition();if(dmobile.application.currentDevice.platform==dmobile.useragent.devicePlatform.Android)this.element.style.paddingRight="9999em",this.element.style.marginRight="-9999em",$(".ad").css({left:"-1px"})};
dmobile.advertisements.AdvertisementFooter.prototype.initializeScrollListener=function(){var a=this;this.currentDevice.platform==dmobile.useragent.devicePlatform.WindowsMobile?window.attachEvent("onscroll",function(){a.adjustAdPosition()}):window.addEventListener("scroll",function(){a.adjustAdPosition()},!1)};dmobile.advertisements.AdvertisementFooter.prototype.initializePlatformConstants=function(){this.currentDevice=dmobile.application.currentDevice};
dmobile.advertisements.AdvertisementFooter.prototype.initializeAdPosition=function(){if(this.currentDevice.platform==dmobile.useragent.devicePlatform.iOS)if(this.currentDevice.os.majorVersion>=5)this.element.style.position="fixed",this.element.style.bottom="0px";else{var a=this;a.adjustAdPosition();var b=function(){a.adjustAdPosition()};addEventListener("load",function(){removeEventListener("load",arguments.callee);setTimeout(b,500)},!1)}else switch(this.currentDevice.platform){case dmobile.useragent.devicePlatform.Android:this.element.style.position=
"fixed";this.element.style.bottom="-3px";break;case dmobile.useragent.devicePlatform.BlackBerry:this.element.style.position="fixed";this.element.style.bottom="0em";break;case dmobile.useragent.devicePlatform.WindowsMobile:this.element.style.position="absolute",this.element.style.bottom="215px"}};
dmobile.advertisements.AdvertisementFooter.prototype.adjustAdPosition=function(){var a=this.currentDevice.platform==dmobile.useragent.devicePlatform.WindowsMobile?document.documentElement.scrollTop:window.pageYOffset,b=window.innerHeight?window.innerHeight:window.document.body.clientHeight;if(this.currentDevice.platform==dmobile.useragent.devicePlatform.iOS){if(this.currentDevice.os.majorVersion<5)this.element.style.top=b+a-this.element.clientHeight+"px"}else switch(this.currentDevice.platform){case dmobile.useragent.devicePlatform.BlackBerry:this.element.style.display=
"block";break;case dmobile.useragent.devicePlatform.WindowsMobile:this.element.style.bottom=215-a+"px"}};dmobile.advertisements.AdvertisementFooter.prototype.touchEnabled=function(){switch(this.currentDevice.platform){case dmobile.useragent.devicePlatform.WindowsMobile:case dmobile.useragent.devicePlatform.Unknown:return!1;default:return!0}};dmobile.advertisements.AdvertisementFooter.prototype.handleEvent=function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchend":this.onTouchEnd(a)}};
dmobile.advertisements.AdvertisementFooter.prototype.onTouchStart=function(a){var b=$(this.element),c=parseInt(b.css("top"),10),d=b.width(),e=parseInt(b.css("top"),10)+b.height(),f=a.touches[0].pageX,a=a.touches[0].pageY;if(this.currentDevice.platform==dmobile.useragent.devicePlatform.Android||this.currentDevice.platform==dmobile.useragent.devicePlatform.BlackBerry)c=window.pageYOffset+(window.innerHeight?window.innerHeight:window.document.body.clientHeight)-b.height(),e=c+b.height();(!(0<=f&&f<=
d)||!(c<=a&&a<=e))&&this.hideAd()};dmobile.advertisements.AdvertisementFooter.prototype.onTouchEnd=function(){this.showAd()};dmobile.advertisements.AdvertisementFooter.prototype.hideAd=function(){this.element.style.display="none"};dmobile.advertisements.AdvertisementFooter.prototype.showAd=function(){this.element.style.display="block"};dmobile=dmobile||{};dmobile.application=dmobile.application||{};dmobile.application.tags=dmobile.application.tags||{};dmobile.application.vendor=dmobile.application.vendor||{};
$(function(){var a=new dmobile.useragent.UserAgent;a.platform==dmobile.useragent.devicePlatform.Unknown&&window.location.hash.indexOf("noua")==-1?window.location="/wap":(dmobile.application.currentDevice={platform:a.platform,formFactor:a.formFactor},dmobile.application.currentDevice.os={majorVersion:a.majorVersion,minorVersion:a.minorVersion},dmobile.application.mainMenu=new dmobile.MainMenu,dmobile.application.favorites=new dmobile.Favorites,dmobile.application.advertisement=new dmobile.advertisements.Advertisement,
dmobile.application.currentDevice.formFactor=="tablet"&&(dmobile.utils.applySuffixForUserAgent($("#content")),dmobile.utils.applySuffixForUserAgent($("#nav-container"))),dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.WindowsMobile&&addEventListener("load",function(){removeEventListener("load",arguments.callee);setTimeout(hideURLbar,0)},!1))});function hideURLbar(){window.scrollTo(0,1)};dmobile=dmobile||{};dmobile.DateTime={};dmobile.DateTime.days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];dmobile.DateTime.months=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"];dmobile=dmobile||{};
dmobile.Favorites=function(){this.localStorageSupported=!1;this.KEY_PROPERTY="properties";this.KEY_CONTENT_TYPE="contentcategory";this.BASE_SERVICE_URL="/services/favorites/";this.dataObject={};this.dataObject[this.KEY_PROPERTY]={};this.dataObject[this.KEY_CONTENT_TYPE]={};this.data=[];this.currentRecommended=this.currentFavorites=this.currentCMSIds=null;try{if(this.localStorageSupported="localStorage"in window&&window.localStorage!==null,this.localStorageKey="favorites",this.localStorageSupported&&typeof localStorage[this.localStorageKey]!=
"undefined"){if(localStorage[this.localStorageKey]!=null)this.dataObject=JSON.parse(localStorage[this.localStorageKey]);for(var a in this.dataObject)for(var b in this.dataObject[a])this.data.push({key:b,value:this.dataObject[a][b],type:a});this.data.sort(function(a,b){var c=a.key.toLowerCase().charAt(0),g=b.key.toLowerCase().charAt(0);if(c<g)return-1;if(c>g)return 1;return 0})}}catch(c){this.localStorageSupported=!1}};
dmobile.Favorites.prototype.getFavoriteContent=function(a){if(!a)throw"Undefined callback function";if(this.localStorageSupported){var b=this.BASE_SERVICE_URL+"?type=favorites",c=this,d;for(d in this.dataObject){var e=[],f;for(f in this.dataObject[d])e.push(f);e.length>0&&(b=b+"&"+d+"="+e.join("||"))}$.ajax({type:"GET",url:b,dataType:"json",success:function(b){if(b.ok&&typeof b.results!="undefined")for(var d in c.currentFavorites=[],c.currentCMSIds=[],b.results)result=b.results[d],c.currentFavorites.push(result),
c.currentCMSIds.push(result.id);a(b.ok,c.currentFavorites)},error:function(){a(!1,null)}})}else a(!1,null)};
dmobile.Favorites.prototype.getRecommendedContent=function(a){if(!a)throw"Undefined callback function";if(this.localStorageSupported){var b=this.BASE_SERVICE_URL+"?type=recommended",c=this;this.currentCMSIds!=null&&this.currentCMSIds.length>0?(b=b+"&cmsids="+this.currentCMSIds.join(","),$.ajax({type:"GET",url:b,dataType:"json",success:function(b){if(b.ok&&typeof b.results!="undefined")for(var e in c.currentRecommended=[],b.results)result=b.results[e],c.currentRecommended.push(result);a(b.ok,c.currentRecommended)},
error:function(){a(!1,null)}})):a(!1,null)}else a(!1,null)};dmobile.Favorites.prototype.add=function(a,b,c){this.localStorageSupported&&(a=this.dataObject[a],typeof a[b]=="undefined"&&(c==null&&(c=b),a[b]=c,this.flush()))};dmobile.Favorites.prototype.remove=function(a,b){if(this.localStorageSupported){var c=!1;typeof this.dataObject[a]!="undefined"&&typeof this.dataObject[a][b]!="undefined"&&(c=!0);if(c){var d=this;dmobile.popup.confirm(function(c){c&&(delete d.dataObject[a][b],d.flush())})}}};
dmobile.Favorites.prototype.removeAll=function(){this.dataObject={};this.dataObject[this.KEY_PROPERTY]={};this.dataObject[this.KEY_CONTENT_TYPE]={};this.flush()};dmobile.Favorites.prototype.flush=function(){localStorage[this.localStorageKey]=JSON.stringify(this.dataObject)};dmobile=dmobile||{};dmobile.media=dmobile.media||{};dmobile.media.AudioPlayer=function(a){this.player=new Audio;this.player.autoplay=!0;this.isPlaying=!1;this.player.addEventListener("ended",a,!1)};dmobile.media.AudioPlayer.prototype.play=function(a){this.isPlaying&&this.pause();this.player.src=a;this.player.play();this.isPlaying=!0};dmobile.media.AudioPlayer.prototype.pause=function(){this.isPlaying=!1;this.player.pause()};dmobile=dmobile||{};dmobile.media=dmobile.media||{};dmobile.media.VideoPlayer=function(){this.videoPlayer=this.closeBtn=this.playerWrapper=this.container=null;dmobile.application.currentDevice.platform=="ios"&&(this.createPlayer(),dmobile.application.currentDevice.formFactor=="tablet"?this.initializeiOSTablet():this.initializeiOSHandheld())};
dmobile.media.VideoPlayer.prototype.createPlayer=function(){this.container=document.createElement("div");this.container.id="video-player";this.container.style.display="none";var a=this.videoPlayer=document.createElement("video");if(dmobile.application.currentDevice.formFactor=="tablet"){this.playerWrapper=document.createElement("div");this.playerWrapper.id="player-wrapper";this.closeBtn=document.createElement("div");this.closeBtn.className="modal-close modal-btn";this.playerWrapper.appendChild(this.closeBtn);
this.playerWrapper.appendChild(this.videoPlayer);var a=this.playerWrapper,b=this;$(this.closeBtn).click(function(){b.closeButtonClicked()})}else this.videoPlayer.width=320;this.container.appendChild(a);document.getElementById("content-wrapper");document.body.appendChild(this.container,document.body.firstChild)};
dmobile.media.VideoPlayer.prototype.play=function(a,b){this.container!=null&&(this.videoPlayer.setAttribute("src",a),b&&(this.videoPlayer.setAttribute("autoplay","true"),this.videoPlayer.play()),dmobile.application.currentDevice.formFactor=="tablet"&&(this.videoPlayer.setAttribute("controls","true"),this.videoPlayer.setAttribute("width","640"),this.videoPlayer.setAttribute("height","480")),this.transitionIn())};dmobile.media.VideoPlayer.prototype.initializeiOSHandheld=function(){};
dmobile.media.VideoPlayer.prototype.initializeiOSTablet=function(){this.container.style.backgroundColor="rgba(0,0,0,0.8)"};dmobile.media.VideoPlayer.prototype.transitionIn=function(){switch(dmobile.application.currentDevice.platform){case "ios":dmobile.application.currentDevice.formFactor=="tablet"?this.iOS_transitionInTablet():this.iOS_transitionInHandheld()}};
dmobile.media.VideoPlayer.prototype.iOS_transitionInHandheld=function(){var a=this;this.container.style.display="block";this.videoPlayer.addEventListener("webkitendfullscreen",function(){a.videoPlayer.removeEventListener("webkitendfullscreen",arguments.callee);a.iOS_transitionOutHandheld()},!1);setTimeout(function(){a.container.style.webkitTransition="-webkit-transform 1000ms ease-out";a.container.style.webkitTransform="translate3d( 0, 100%, 0)"},100)};
dmobile.media.VideoPlayer.prototype.iOS_transitionOutHandheld=function(){var a=this;setTimeout(function(){a.container.style.webkitTransition="-webkit-transform 300ms ease-out";a.container.style.webkitTransform="translate3d( 0, -100%, 0)";a.container.addEventListener("webkitTransitionEnd",function(){a.container.removeEventListener("webkitTransitionEnd",arguments.callee);a.container.removeChild(a.videoPlayer);a.videoPlayer=null;a.container.style.display="none";var b=document.getElementById("content-wrapper");
if(a.container!=null)try{b.removeChild(a.container),a.container=null}catch(c){}})},400)};dmobile.media.VideoPlayer.prototype.iOS_transitionInTablet=function(){var a=this;this.container.style.opacity=0;this.container.style.display="block";this.container.style.top="0";this.container.style.webkitTransition="opacity 500ms linear";this.playerWrapper.style.top=window.pageYOffset+"px";setTimeout(function(){a.container.style.opacity=1},100)};
dmobile.media.VideoPlayer.prototype.closeButtonClicked=function(){this.videoPlayer.pause();this.iOS_transitionOutTablet()};dmobile.media.VideoPlayer.prototype.iOS_transitionOutTablet=function(){var a=this;a.container.addEventListener("webkitTransitionEnd",function(){a.container.style.display="none";a.container.removeEventListener("webkitTransitionEnd",arguments.callee)});this.container.style.opacity=0};dmobile=dmobile||{};
dmobile.MainMenu=function(a){var b=$("#disney-menu-wrapper .expand"),c=$("#disney-menu-wrapper .collapse"),d=$("#disney-menu-wrapper .like");this.transformsEnabled=Modernizr.csstransforms3d?!0:!1;if(a)b=typeof a.openButton=="undefined"?b:a.openButton,c=typeof a.closeButton=="undefined"?c:a.closeButton,this.menuWillOpen=typeof a.menuWillOpen=="undefined"?null:a.menuWillOpen,this.menuWillClose=typeof a.menuWillClose=="undefined"?null:a.menuWillClose;this.setMenuIsOpen(!1);this.setOpenButton(b);this.setCloseButton(c);
this.setFavoritesButton(d)};
dmobile.MainMenu.prototype.setFavoritesButton=function(a){var b=this;a.click(function(){if(dmobile.application.tags.property!=null&&dmobile.application.tags.property.length>0){var a=dmobile.application.tags.property,d=b.parseFavorite(dmobile.application.tags.property);dmobile.application.favorites.add(dmobile.application.favorites.KEY_PROPERTY,a,d)}if(dmobile.application.tags.contentType!=null&&dmobile.application.tags.contentType.length>0)a=dmobile.application.tags.contentType,d=b.parseFavorite(dmobile.application.tags.contentType),
dmobile.application.favorites.add(dmobile.application.favorites.KEY_CONTENT_TYPE,a,d);b.close();return!1})};
dmobile.MainMenu.prototype.parseFavorite=function(a){a=a.split("");a[0]=a[0].toUpperCase();for(var a=a.join(""),a=a.split("-").join(" "),a=a.split("_").join(" "),b="",c=[],a=a.split(""),d=0;d<a.length;d++){var e=a[d];b!=""&&b!=" "&&e!=" "&&e==e.toUpperCase()&&c.push(" ");c.push(e);b=e}a=c.join("");a=a.split(" ");for(d=0;d<a.length;d++)word=a[d],b=word.split(""),b.length>3&&(b[0]=b[0].toUpperCase(),a[d]=b.join(""));return a=a.join(" ")};
dmobile.MainMenu.prototype.setOpenButton=function(a){var b=this;if(this.openButton)this.openButton.unbind("click"),this.openButton=null;this.openButton=a;this.openButton.click(function(a){b.open();a.preventDefault()})};dmobile.MainMenu.prototype.setCloseButton=function(a){var b=this;if(this.closeButton)this.closeButton.unbind("click"),this.closeButton=null;this.closeButton=a;this.closeButton.click(function(a){b.close();a.preventDefault()})};
dmobile.MainMenu.prototype.setMenuIsOpen=function(a){this.menuIsOpen=a};dmobile.MainMenu.prototype.open=function(){this.menuIsOpen==!1&&(this.setMenuIsOpen(!0),this.menuWillOpen!=null&&this.menuWillOpen(this,this.transformsEnabled),this.transformsEnabled?($(".disney-menu").addClass("expanded"),$(".content").addClass("expanded"),$(".drop-down").addClass("expanded")):($(".disney-menu").addClass("expanded-ie7"),$(".content").addClass("expanded"),$(".drop-down").addClass("expanded-ie7")))};
dmobile.MainMenu.prototype.close=function(){this.menuIsOpen&&(this.setMenuIsOpen(!1),this.menuWillClose!=null&&this.menuWillClose(this,this.transformsEnabled),this.transformsEnabled?($(".disney-menu").removeClass("expanded"),$(".content").removeClass("expanded"),$(".drop-down").removeClass("expanded")):($(".disney-menu").removeClass("expanded-ie7"),$(".content").removeClass("expanded"),$(".drop-down").removeClass("expanded-ie7")))};dmobile=dmobile||{};
dmobile.Modal={centerModal:function(a){a=$(a?a:"#modal");if(a.is(":visible")){var b=a.height(),c=$(window),d=c.scrollTop()==0?30:c.scrollTop(),e=dmobile.Modal.getWindowHeight(),b=d+(e-b)/2;dmobile.application.currentDevice.platform==dmobile.useragent.devicePlatform.WindowsMobile&&(d=c.scrollTop(),b=d+35);a.css({top:b+"px"})}dmobile.Modal.resizeOverlay()},resizeOverlay:function(){$(".modal-overlay").css({position:"absolute",height:2E4})},getWindowHeight:function(){return window.innerHeight?window.innerHeight:
$(window).height()},disableNativeScrolling:function(){document.body.addEventListener("touchmove",dmobile.Modal.removeNativeScrolling)},enableNativeScrolling:function(){document.body.removeEventListener("touchmove",dmobile.Modal.removeNativeScrolling)},removeNativeScrolling:function(a){a.preventDefault()}};dmobile=dmobile||{};dmobile.notifications={};
dmobile.notifications.alert=function(a){dmobile.Modal.disableNativeScrolling();var b=a.title,c=a.message,d=a.no,a=a.confirmMethod,e=$("#notification").text(),f=$("body"),g=null,i=this,h={title:null,message:null,yes:null,no:null};h.title=b;h.message=c;h.yes=d;h.no=d;g=$(Mustache.to_html(e,h));g.css("top",document.body.scrollTop);g.prependTo(f);$(".yes").click(function(a){a.preventDefault();i.confirmMethod();dmobile.Modal.enableNativeScrolling()});$(".no").click(function(){g.remove();dmobile.Modal.enableNativeScrolling()});
a||$(".yes").hide()};dmobile=dmobile||{};
dmobile.Pipe=function(a){this.target=a;this._currentPage=1;this.rightArrow=a.find(".right-arrow.arrow-button");this.leftArrow=a.find(".left-arrow.arrow-button");this.counter=a.find(".counter > span");this.list=a.find("> ul");this.scrollview=null;this.animateToX=0;this.cellWidth=parseInt(this.list.find("li:first").width(),10);this.userInteractionEnabled=!0;this.perPage=this.target.hasClass("two-up")?2:this.target.hasClass("three-up")?3:1;this.totalPages=Math.ceil(this.list.children().length/this.perPage);
this.updatePageText();var b=this;if(this.totalPages>1){this.shouldHideShowArrows()&&(this.rightArrow.show(),this.leftArrow.hide());this.rightArrow.click(function(){b.next()});this.leftArrow.click(function(){b.previous()});if(!(dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.iOS&&dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.Android))this.scrollview=new dmobile.scrollview.HorizontalScrollView(this.list[0],{pageWidth:this.scrollDistance(),
totalPages:this.totalPages,delegate:this});this.counter.parent().show()}else this.shouldHideShowArrows()&&(this.rightArrow.hide(),this.leftArrow.hide()),this.counter.parent().hide()};dmobile.Pipe.prototype.shouldHideShowArrows=function(){return!0};dmobile.Pipe.prototype.scrollViewShouldChangePage=function(a,b,c){if(b<0)return!1;if(b>=c)return!1;return!0};
dmobile.Pipe.prototype.scrollViewDidChange=function(){this.setCurrentPage(this.scrollview.pageNumber+1);this.updatePageText();this._currentPage==1?this.shouldHideShowArrows()&&(this.leftArrow.hide(),this.rightArrow.show()):this._currentPage==this.totalPages?this.shouldHideShowArrows()&&(this.leftArrow.show(),this.rightArrow.hide()):this.shouldHideShowArrows()&&(this.leftArrow.show(),this.rightArrow.show())};dmobile.Pipe.prototype.setCurrentPage=function(a){this._currentPage=a};
dmobile.Pipe.prototype.gotoPage=function(a){this.userInteractionEnabled&&(a+=1,a<=this.totalPages&&a>0&&(this.animateTo(-this.scrollDistance()*(a-1),0),this.setCurrentPage(a),this.updatePageText(),this._currentPage==1?this.shouldHideShowArrows()&&(this.leftArrow.hide(),this.rightArrow.show()):this._currentPage==this.totalPages?this.shouldHideShowArrows()&&(this.leftArrow.show(),this.rightArrow.hide()):this.shouldHideShowArrows()&&(this.leftArrow.show(),this.rightArrow.show())))};
dmobile.Pipe.prototype.shouldGotoNextPage=function(){return this._currentPage<this.totalPages};
dmobile.Pipe.prototype.next=function(){this.userInteractionEnabled&&(this.shouldGotoNextPage()?(this.setCurrentPage(this._currentPage+1),this.updatePageText(),this.animateTo(this.perPage*this.cellWidth*(this._currentPage==1?0:this._currentPage-1)*-1,500),this.leftArrow.is(":visible")==!1&&this.shouldHideShowArrows()&&this.leftArrow.show(),this._currentPage==this.totalPages&&this.shouldHideShowArrows()&&this.rightArrow.hide()):this.shouldHideShowArrows()&&this.rightArrow.hide())};
dmobile.Pipe.prototype.shouldGotoPreviousPage=function(){return this._currentPage>1};
dmobile.Pipe.prototype.previous=function(){this.userInteractionEnabled&&this.shouldGotoPreviousPage()&&(this.setCurrentPage(this._currentPage-1),this.updatePageText(),this.animateTo(this.perPage*this.cellWidth*(this._currentPage==1?0:this._currentPage-1)*-1,500),this._currentPage==1&&this.shouldHideShowArrows()&&this.leftArrow.hide(),this.totalPages>1&&this._currentPage>=1&&this.rightArrow.is(":visible")==!1&&this.shouldHideShowArrows()&&this.rightArrow.show())};
dmobile.Pipe.prototype.scrollDistance=function(){if(typeof this.pageSize=="undefined")this.pageSize=this.cellWidth*this.perPage;return this.pageSize};dmobile.Pipe.prototype.animationComplete=function(){this.userInteractionEnabled=!0};dmobile.Pipe.prototype.updatePageText=function(){this.counter&&this.counter.text(this._currentPage+"/"+this.totalPages)};
dmobile.Pipe.prototype.clearWebKitTransition=function(a){var b=document.defaultView.getComputedStyle(this.list[0],null);new WebKitCSSMatrix(b.webkitTransform);this.list[0].style.webkitTransition="";this.list[0].style.webkitTransform="translate3d("+a+"px, 0, 0)"};
dmobile.Pipe.prototype.animateTo=function(a,b,c){var d=this.animateToX;this.animateToX=a;b=b!=void 0?b:0;if(dmobile.application.currentDevice.platform==dmobile.useragent.devicePlatform.WindowsMobile)b!=0?this.list.animate({left:a,useTranslate3d:!0},b):this.list.css({left:a});else{this.clearWebKitTransition(d);if(b>0)this.list[0].style.webkitTransition="-webkit-transition-delay now",this.list[0].style.webkitTransition="-webkit-transform "+b+"ms ";this.list[0].style.webkitTransform="translate3d("+a+
"px, 0, 0)"}if(c){var e=this.list[0],f=this;this.list[0].addEventListener("webkitTransitionEnd",function(){return function(){c(f);e.removeEventListener("webkitTransitionEnd",arguments.callee)}}())}};dmobile=dmobile||{};
dmobile.PipeCircular=function(a){this.MIN_TRACKING_FOR_DRAG=15;this.PERCENT_CHANGE_THRESHOLD=20;this.element=a;this._currentPage=0;this.lastPlacedTouch=this.mouseStartX=this.rebuiltList=this.elementWidth=null;this.ulInTransition=!1;this.ul=this.element.find("> ul");this.originalLength=a.find("> ul li").length;this.ulStartX=0;this._isDragging=!1;this.pageWidth=$(window).width();this.rebuild();this.restyle();this.totalPages=this.rebuiltList.length;this.resortForPage(this._currentPage);this.incrementor=
1;dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.WindowsMobile&&(this.ul[0].addEventListener("touchstart",this,!1),this.ul[0].addEventListener("touchmove",this,!1),this.ul[0].addEventListener("touchend",this,!1));this.incrementor=a.hasClass("five-up")?5:this.incrementor;this.incrementor=a.hasClass("four-up")?4:this.incrementor;this.incrementor=a.hasClass("three-up")?3:this.incrementor;this.incrementor=a.hasClass("two-up")?2:this.incrementor;this.rightArrow=a.find(".right-arrow.arrow-button");
this.leftArrow=a.find(".left-arrow.arrow-button");var b=this;this.rightArrow.click(function(){b.next()});this.leftArrow.click(function(){b.previous()})};dmobile.PipeCircular.prototype.next=function(){var a=this.incrementor,b={time:500};b.xPos=-Math.round(this.pageWidth/this.elementWidth)*this.elementWidth-(this._currentPage+a)*this.elementWidth;this.animateTo(this.ul,b);this.setCurrentPage(this._currentPage+a)};
dmobile.PipeCircular.prototype.previous=function(){var a=this.incrementor,b={time:500};b.xPos=-Math.round(this.pageWidth/this.elementWidth)*this.elementWidth-(this._currentPage-a)*this.elementWidth;this.animateTo(this.ul,b);this.setCurrentPage(this._currentPage-a)};
dmobile.PipeCircular.prototype.setCurrentPage=function(a){var b=this._currentPage-a;this._currentPage=a;var a=Math.abs(b),c=0;if(b>0)for(;c<a;)this.unshiftLi(),c++;else for(;c<a;)this.popLi(),c++;this._currentPage>0?b=this._currentPage%this.originalLength:(b=Math.abs(this._currentPage),b=b%this.originalLength+1,b=this.originalLength-b);this.changePageDots(b)};
dmobile.PipeCircular.prototype.changePageDots=function(a){var b=this.element.find(".paging-dots ul li");b.length!=0&&(b.removeClass("selected"),b.eq(a).addClass("selected"))};dmobile.PipeCircular.prototype.popLi=function(){var a=this.getLeftItem(),b=this.getRightItem(),c={time:0};c.xPos=this.getXVal(b)+this.elementWidth;this.animateTo(a,c)};
dmobile.PipeCircular.prototype.unshiftLi=function(){var a=this.getLeftItem(),b=this.getRightItem(),c={time:0};c.xPos=this.getXVal(a)-this.elementWidth;this.animateTo(b,c)};dmobile.PipeCircular.prototype.getLeftItem=function(){for(var a=null,b=null,c=this.rebuiltList.length-1;c>=0;c--){var d=this.rebuiltList.eq(c),e=this.getXVal(d);a?e<b&&(a=d,b=e):(a=d,b=e)}return a};
dmobile.PipeCircular.prototype.getRightItem=function(){for(var a=null,b=null,c=this.rebuiltList.length-1;c>=0;c--){var d=this.rebuiltList.eq(c),e=this.getXVal(d);a?e>b&&(a=d,b=e):(a=d,b=e)}return a};dmobile.PipeCircular.prototype.getXVal=function(a){var b=a[0].style.left.replace("px","");dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.WindowsMobile&&(b=(a=a.css("-webkit-transform").split(",")[4])?a:0);return parseInt(b,10)};
dmobile.PipeCircular.prototype.rebuild=function(){var a=this.element.find("> ul"),b=this.element.find("> ul li");this.elementWidth=b.eq(0).outerWidth(!0);for(var c=$(window).width(),c=Math.round(c/this.elementWidth),d=c*3,e=0,f=b.length;f+e<d;)a.append(b.eq(e%f).clone()),e++;this.rebuiltList=this.element.find("> ul li");a={time:0};a.xPos=-c*this.elementWidth;this.animateTo(this.element.find("> ul"),a)};dmobile.PipeCircular.prototype.restyle=function(){this.rebuiltList.css({position:"absolute","float":"none"})};
dmobile.PipeCircular.prototype.resortForPage=function(){var a=this;this.rebuiltList.each(function(b){var c={time:0};c.xPos=b*a.elementWidth;a.animateTo($(this),c)})};dmobile.PipeCircular.prototype.handleEvent=function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchmove":this.onTouchMove(a);break;case "touchend":this.onTouchEnd(a)}};
dmobile.PipeCircular.prototype.onTouchStart=function(a){this.mouseStartX=a.touches[0].clientX;this.ulStartX=this.leftPos();this.startX=a.touches[0].clientX;this.lastPlacedTouch=a.touches[0].clientX};
dmobile.PipeCircular.prototype.onTouchMove=function(a){this.lastPlacedTouch=a.touches[0].clientX;var b=this.startX-a.touches[0].clientX;if(this.isDragging(b)){var c={time:0};c.xPos=this.ulStartX-b;this.animateTo(this.ul,c)}this.startX-a.touches[0].clientX>this.MIN_TRACKING_FOR_DRAG&&document.body.addEventListener("touchmove",this.disableNativeScrolling)};
dmobile.PipeCircular.prototype.onTouchEnd=function(){document.body.removeEventListener("touchmove",this.disableNativeScrolling);this._isDragging=!1;var a=-Math.round(this.pageWidth/this.elementWidth)*this.elementWidth-this._currentPage*this.elementWidth,b=this.leftPos(),c=this.startX-this.lastPlacedTouch;if(!((b||0)==0&&c<=0))Math.abs(c/this.elementWidth*100)<=this.PERCENT_CHANGE_THRESHOLD?c={time:500}:(b=Math.abs(Math.round(c/this.elementWidth)),b==0&&(b=1),c>0?a-=this.elementWidth*b:(a+=this.elementWidth*
b,b=-b),this.setCurrentPage(this._currentPage+b),c={},c.time=500),c.xPos=a,this.animateTo(this.ul,c)};dmobile.PipeCircular.prototype.isDragging=function(a){if(this._isDragging)return this._isDragging;if(a&&Math.abs(a)>this.MIN_TRACKING_FOR_DRAG)return this._isDragging=!0;return!1};dmobile.PipeCircular.prototype.disableNativeScrolling=function(a){a.preventDefault()};
dmobile.PipeCircular.prototype.leftPos=function(){var a=this.ul.css("-webkit-transform").split(",")[4],a=a?a:0,b=this.ul[0].style.left.replace("px","");dmobile.application.currentDevice.platform!=dmobile.useragent.devicePlatform.WindowsMobile&&(b=a);return parseInt(b,10)};
dmobile.PipeCircular.prototype.animateTo=function(a,b){if(!b)b={},b.time=0,b.callback=null,b.xPos=0;if(!b.time)b.time=0;dmobile.application.currentDevice.platform==dmobile.useragent.devicePlatform.WindowsMobile?b.time==0?(a.css({left:b.xPos+"px"}),b.callback&&b.callback()):a.animate({left:b.xPos},b.time,function(){b.callback&&b.callback()}):(a[0].style.webkitTransition="-webkit-transform "+b.time+"ms ",a[0].style.webkitTransform="translate3d("+b.xPos+"px, 0, 0)",b.callback&&a[0].addEventListener("webkitTransitionEnd",
function(){return function(){b.callback();a[0].removeEventListener("webkitTransitionEnd",arguments.callee)}}()))};dmobile=dmobile||{};dmobile.popup={};dmobile.popup.confirm=function(a){a(!0)};dmobile=dmobile||{};dmobile.scrollview={};
dmobile.scrollview.HorizontalScrollView=function(a,b){this.delegate=typeof b.delegate=="undefined"?null:b.delegate;this.element=a;this.pagesize=b.pageWidth;this.totalPages=b.totalPages;this.totalWidth=this.pagesize*this.totalPages;this.direction=null;this.pageNumber=this.startX=0;this.lastPlacedTouch=null;this.ulStartX=a.style.left.replace("px","");this.elementWidth=a.style.width.replace("px","");this.isVerticalScrolling=!1;this.PERCENT_CHANGE_THRESHOLD=this.MIN_TRACKING_FOR_DRAG=15;this.MOMENTUM_TIMING_FUNCTION=
"cubic-bezier(0.33, 0.66, 0.47, 1)";a.addEventListener("touchstart",this,!1);a.addEventListener("touchmove",this,!1);a.addEventListener("touchend",this,!1)};dmobile.scrollview.HorizontalScrollView.prototype.handleEvent=function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchmove":this.onTouchMove(a);break;case "touchend":this.onTouchEnd(a)}};
dmobile.scrollview.HorizontalScrollView.prototype.onTouchStart=function(a){this.startX=a.touches[0].clientX;this.lastPlacedTouch=a.touches[0].clientX;this.ulStartX=this.leftPos()};
dmobile.scrollview.HorizontalScrollView.prototype.onTouchMove=function(a){this.lastPlacedTouch=a.touches[0].clientX;var b=this.startX-a.touches[0].clientX;this.direction=this.startX-this.lastPlacedTouch>0?1:-1;if(this.isDragging(b)){var b=this.ulStartX-b,c=b*-1/this.pagesize,c=this.lastPlacedTouch>this.startX?Math.ceil(c):Math.floor(c);this.animateTo(b);if(c!=this.pageNumber)if(this.delegate&&typeof this.delegate.scrollViewShouldChangePage!="undefined"){if(this.delegate.scrollViewShouldChangePage(this,
c,this.totalPages))this.pageNumber=c}else this.pageNumber=c;this.delegate&&typeof this.delegate.scrollViewDidChange!="undefined"&&this.delegate.scrollViewDidChange(this)}this.startX-a.touches[0].clientX>this.MIN_TRACKING_FOR_DRAG&&document.body.addEventListener("touchmove",this.disableNativeScrolling)};
dmobile.scrollview.HorizontalScrollView.prototype.onTouchEnd=function(){this.direction=null;document.body.removeEventListener("touchmove",this.disableNativeScrolling);this._isDragging=!1;var a=this.leftPos(),b=this.startX-this.lastPlacedTouch;if(!((a||0)==0&&b<=0))if(Math.abs(b/this.pagesize*100)>=this.PERCENT_CHANGE_THRESHOLD)b=this.pageNumber+(b/this.pagesize*100>0?1:-1),b=b<0?0:b,this.pageNumber=b=b>this.totalPages-1?this.totalPages-1:b,this.animateTo(-1*b*this.pagesize,500),this.delegate&&typeof this.delegate.scrollViewDidChange!=
"undefined"&&this.delegate.scrollViewDidChange(this);else{a=Math.abs(Math.round(b/this.pagesize));b=Math.round((b>0?this.ulStartX-this.pagesize*a:this.ulStartX+this.pagesize*a)*-1/this.pagesize);if(this.delegate&&typeof this.delegate.scrollViewShouldChangePage!="undefined"){if(this.delegate.scrollViewShouldChangePage(this,b,this.totalPages))this.pageNumber=b}else if(this.pageNumber>=this.totalPages-1)this.pageNumber=this.totalPages-1;this.animateTo(-this.pageNumber*this.pagesize,500);this.delegate&&
typeof this.delegate.scrollViewDidChange!="undefined"&&this.delegate.scrollViewDidChange(this);var c=null;if(this.delegate&&typeof this.delegate.onScrollComplete)c=this.delegate.onScrollComplete;var d=this.element,e=this.delegate;this.element.addEventListener("webkitTransitionEnd",function(){return function(){c&&c(e);d.removeEventListener("webkitTransitionEnd",arguments.callee)}}())}};dmobile.scrollview.HorizontalScrollView.prototype.disableNativeScrolling=function(a){a.preventDefault()};
dmobile.scrollview.HorizontalScrollView.prototype.isDragging=function(a){if(this._isDragging)return this._isDragging;if(a&&Math.abs(a)>this.MIN_TRACKING_FOR_DRAG)return this._isDragging=!0;return!1};dmobile.scrollview.HorizontalScrollView.prototype.leftPos=function(){var a=$(this.element).css("-webkit-transform").split(",")[4],a=a?a:0,b=this.element.style.left.replace("px","");return parseInt(a,10)};
dmobile.scrollview.HorizontalScrollView.prototype.animateTo=function(a,b){this.element.style.webkitTransition="-webkit-transform "+(b!=void 0?b:0)+"ms ";this.element.style.webkitTransform="translate3d("+a+"px, 0, 0)"};dmobile=dmobile||{};dmobile.Search=function(a){this.PER_PAGE=10;this.keywords=a.keywords;this.refinements="";this.totalPages=null;this.currentPage=1;var b=[];typeof a.property!="undefined"&&a.property.length>0&&b.push("property~"+a.property);typeof a.contentType!="undefined"&&a.contentType.length>0&&b.push("contentcategory~"+a.contentType);if(b.length>0)this.refinements=b.join("::")};
dmobile.Search.prototype.fetchPage=function(a,b){var c=0,d=this;if(typeof a=="object")b=a;else{a<1&&(a=1);if(this.totalPages!=null&&a>this.totalPages)a=this.totalPages;this.currentPage=a;c=this.PER_PAGE*(a-1)}$.ajax({type:"GET",url:"/services/search/?offset="+c+"&query="+this.keywords+"&refinements="+this.refinements,dataType:"json",success:function(a){if(a.ok&&d._totalPages==null)d.totalPages=Math.ceil(a.totalResults/d.PER_PAGE);b(a)}})};dmobile=dmobile||{};dmobile.Showtimes=function(a){this.options=a};
dmobile.Showtimes.prototype.fetch=function(a){$.ajax({type:"GET",url:"/prom/services/showtimes/",data:this.options,dataType:"xml",success:function(b){var c={info:{},theatres:[]},d=$(b).find("info");c.info.title=$(d).find("title").text();c.info.date=$(d).find("date").text();c.info.postalcode=$(d).find("postalcode").text();c.info.latitude=$(d).find("latitude").text();c.info.longitude=$(d).find("longitude").text();$(b).find("theatrelisting").find("theatre").each(function(){var a={};a.radiusdistance=
parseInt($(this).find("radiusdistance").text(),10);a.name=$(this).find("name").text();a.city=$(this).find("city").text();a.address=$(this).find("address").text();a.phone=$(this).find("phone").text();a.showtimes=$(this).find("showtimes").text();a.latitude=parseFloat($(this).find("latitude").text());a.longitude=parseFloat($(this).find("longitude").text());a.movieversion=$(this).find("movieversion").text();a.buyurl=$(this).find("buyurl").text();a.groupurl=$(this).find("groupurl").text();a.buyflag=$(this).find("buyflag").text();
a.fid=$(this).find("fid").text();a.mtid=$(this).find("mtid").text();a.ibid=$(this).find("ibid").text();a.showtimes!=""&&c.theatres.unshift(a)});a(c,"success")},error:function(){a(null,"error")}})};dmobile=dmobile||{};dmobile.useragent={};dmobile.useragent.devicePlatform={Android:"android",BlackBerry:"blackberry",iOS:"ios",WebOS:"webos",WindowsMobile:"windowsmobile",Unknown:"unknown"};dmobile.useragent.deviceFormFactor={Unknown:"unknown",Phone:"phone",Tablet:"tablet"};dmobile.useragent.UserAgent=function(){this.agent=navigator.userAgent.toLowerCase();this.isMobile=!1;this.platform=this.formFactor=dmobile.useragent.devicePlatform.Unknown;this.minorVersion=this.majorVersion=0;this.process()};
dmobile.useragent.UserAgent.prototype.process=function(){this.agent.indexOf("android")>-1?this.processAndroid():this.agent.indexOf("blackberry")>-1||this.agent.indexOf("playbook")>-1?this.processBlackBerry():this.agent.indexOf("iphone")>-1||this.agent.indexOf("ipod")>-1||this.agent.indexOf("ipad")>-1?this.processiOS():this.agent.indexOf("webos")>-1?this.processWebOS():this.agent.indexOf("iemobile")>-1?this.processWindowsMobile():this.processUnknown()};
dmobile.useragent.UserAgent.prototype.processAndroid=function(){this.isMobile=!0;this.platform=dmobile.useragent.devicePlatform.Android;var a=this.agent.indexOf("android "),b=this.agent.indexOf(";",a),a=jQuery.trim(this.agent.substring(a+8,b)).split(".");this.majorVersion=parseInt(a[0],10);this.minorVersion=parseInt(a[1],10);this.formFactor=this.agent.indexOf("xoom")>-1||this.agent.indexOf("gt-p1000")>-1?dmobile.useragent.deviceFormFactor.Tablet:dmobile.useragent.deviceFormFactor.Phone};
dmobile.useragent.UserAgent.prototype.processBlackBerry=function(){this.isMobile=!0;this.platform=dmobile.useragent.devicePlatform.BlackBerry;if(this.agent.indexOf("playbook")>-1){this.formFactor=dmobile.useragent.deviceFormFactor.Tablet;var a="rim tablet os  ",b=this.agent.indexOf(a),c=this.agent.indexOf(";",b+a.length)}else this.formFactor=dmobile.useragent.deviceFormFactor.Phone,a="version/",b=this.agent.indexOf(a),c=this.agent.indexOf(" ",b+a.length);a=jQuery.trim(this.agent.substring(b+a.length,
c));a=a.split(".");this.majorVersion=parseInt(a[0],10);this.minorVersion=parseInt(a[1],10)};dmobile.useragent.UserAgent.prototype.processiOS=function(){this.isMobile=!0;this.platform=dmobile.useragent.devicePlatform.iOS;var a=this.agent.indexOf("os "),b=this.agent.indexOf(" ",a+3),a=jQuery.trim(this.agent.substring(a+3,b)).split("_");this.majorVersion=parseInt(a[0],10);this.minorVersion=parseInt(a[1],10);this.formFactor=this.agent.indexOf("ipad")>-1?dmobile.useragent.deviceFormFactor.Tablet:dmobile.useragent.deviceFormFactor.Phone};
dmobile.useragent.UserAgent.prototype.processWebOS=function(){this.isMobile=!0;this.platform=dmobile.useragent.devicePlatform.WebOS;this.formFactor=dmobile.useragent.deviceFormFactor.Phone;var a=this.agent.indexOf("webos/"),b=this.agent.indexOf(";",a+6),a=jQuery.trim(this.agent.substring(a+6,b)).split(".");this.majorVersion=parseInt(a[0],10);this.minorVersion=parseInt(a[1],10)};
dmobile.useragent.UserAgent.prototype.processWindowsMobile=function(){this.isMobile=!0;this.platform=dmobile.useragent.devicePlatform.WindowsMobile;this.formFactor=dmobile.useragent.deviceFormFactor.Phone;var a=this.agent.indexOf("windows phone os "),b=this.agent.indexOf(";",a+17),a=jQuery.trim(this.agent.substring(a+17,b)).split(".");this.majorVersion=parseInt(a[0],10);this.minorVersion=parseInt(a[1],10)};
dmobile.useragent.UserAgent.prototype.processUnknown=function(){this.isMobile=!1;this.platform=dmobile.useragent.devicePlatform.Unknown;this.formFactor=dmobile.useragent.deviceFormFactor.Unknown};

