
(function(){if(!window.WbxMobileSite){window.WbxMobileSite=WbxMobileSite={galleryUrl:null,cdnGalleryUrl:null,mobileSiteRuntimeUrl:null,syndUrl:null,proxyUrl:null,imageProxyUrl:null,metricsUrl:null,linkbarUrl:"http://wbx-me.postapp.com/",shortWidgetUrl:null,token:null,instPk:null,instId:null,instCreatedByUserPk:null,regPk:null,providerPk:null,partnerNetworkPk:null,userServiceLevel:0,providerServiceLevel:0,registrationServiceLevel:0,instanceServiceLevel:0,topNavItemsVisibleCount:0,isIphone:navigator.userAgent.toLowerCase().match(/iphone/i)=="iphone",isAndroid:navigator.userAgent.toLowerCase().match(/android/i)=="android",isPre:navigator.userAgent.toLowerCase().match(/ pre\//i)==" pre/",isFirefox:navigator.userAgent.toLowerCase().match(/firefox/i)=="firefox",pagination:{size:0,index:0,callback:null,init:function(numberOfItems,callback,startIndex){WbxMobileSite.pagination.callback=callback;WbxMobileSite.pagination.size=numberOfItems;WbxMobileSite.pagination.index=startIndex;WbxMobileSite.pagination.update();},next:function(){if(WbxMobileSite.pagination.index+1<WbxMobileSite.pagination.size)WbxMobileSite.pagination.index++;if(WbxMobileSite.pagination.callback)WbxMobileSite.pagination.callback(WbxMobileSite.pagination.index);WbxMobileSite.pagination.update();},prev:function(){if(WbxMobileSite.pagination.index>0)WbxMobileSite.pagination.index--;if(WbxMobileSite.pagination.callback)WbxMobileSite.pagination.callback(WbxMobileSite.pagination.index);WbxMobileSite.pagination.update();},update:function(){$("#site-prev-btn").css("display",(WbxMobileSite.pagination.index==0)?"none":"block");$("#site-next-btn").css("display",(WbxMobileSite.pagination.index+1>=WbxMobileSite.pagination.size)?"none":"block");},hide:function(){WbxMobileSite.pagination.size=0;WbxMobileSite.pagination.index=0;WbxMobileSite.pagination.update();}},utils:{stripTags:function(str){return(str).replace(/<\/?[^>]+(>|$)/g,"").replace(/^\s+/,"");},toggleLoading:function(show,isDark){document.getElementById("loading").style.display=(show)?"":"none";if(isDark||WbxMobileSite.site.config.theme=="02"||WbxMobileSite.site.config.theme=="04"){$("#loading").addClass("dark");}else{$("#loading").removeClass("dark");}},goBack:function(){if(WbxMobileSite.site.history.length>0){var previousPage=WbxMobileSite.site.history.shift();var anim=previousPage.animationType;if(anim==null)anim="slide";if(anim!="instant")anim+=" reverse";WbxMobileSite.utils.navTo(previousPage.pageKey,anim);}else{$(".current").removeClass("current");}
return false;},getExternalLink:function(url,action){if(window.top!=window.self||WbxMobileSite.metricsUrl==null)return url;if(action==null||action=="")action="click";return WbxEventLogger.getMetricsRedirectUrl(action,"",url);},openExternalLink:function(url,useMobilizer){var noMetrics=(window.top!=window.self||WbxMobileSite.metricsUrl==null);if(useMobilizer){url="http://www.google.com/gwt/x?u="+encodeURIComponent(url);}
var action=noMetrics?url:WbxEventLogger.getMetricsRedirectUrl("click","",url,true);if(noMetrics){window.open(action,"_blank");}else{var formEl=document.createElement("form");formEl.method="post";formEl.action=action;if(noMetrics)formEl.target="_blank";document.body.appendChild(formEl);formEl.submit();}},navTo:function(pageKey,animationType){if(WbxMobileSite.site.currentPage!=pageKey){WbxMobileSite.site.renderPage(pageKey);WbxMobileSite.site.setCurrentPage(pageKey,animationType);}
return false;},showFullImage:function(imgUrl){},setHeaderTitle:function(title){},getData:function(page){},disableScrolling:function(){if(WbxMobileSite.site.currentScroller!=null){var iscroll=WbxMobileSite.site.currentScroller;if(iscroll.scrollbars.x){iscroll.wrapper.removeChild(iscroll.scrollbars.x.wrapper);iscroll.wrapper.removeChild(iscroll.scrollbars.x.jollyCorner);}
if(iscroll.scrollbars.y){iscroll.wrapper.removeChild(iscroll.scrollbars.y.wrapper);iscroll.wrapper.removeChild(iscroll.scrollbars.y.jollyCorner);}
WbxMobileSite.site.currentScroller=null;}},enableSwiping:function(pageKey){if(WbxMobileSite.site.currentScroller!=null)WbxMobileSite.utils.disableScrolling();var contentId=pageKey+"-content";setTimeout(function(){WbxMobileSite.site.currentScroller=new iScroll(document.getElementById(contentId),"none","horizontal");},100);},enableXYScrolling:function(pageKey){if(WbxMobileSite.site.currentScroller!=null)WbxMobileSite.utils.disableScrolling();var contentId=pageKey+"-content";setTimeout(function(){WbxMobileSite.site.currentScroller=new iScroll(document.getElementById(contentId),"xy");},100);},enableScrolling:function(pageKey){if(WbxMobileSite.site.currentScroller!=null)WbxMobileSite.utils.disableScrolling();var contentId=pageKey+"-content";setTimeout(function(){WbxMobileSite.site.currentScroller=new iScroll(document.getElementById(contentId),"y");},100);},getProxyImageSrc:function(src,maxWidth,maxHeight,fill){var url=WbxMobileSite.imageProxyUrl;var hasQS=false;if(maxWidth){url+="w=="+maxWidth;hasQS=true;}
if(maxHeight){if(hasQS)url+="&&";url+="h=="+maxHeight;hasQS=true;}
if(fill){if(hasQS)url+="&&";url+="type==fill";hasQS=true;}
if(hasQS)url+="&&";url+="origin=="+encodeURIComponent(src)+"?token="+WbxMobileSite.token;return url;},adjustNav:function(){var nav=document.getElementById("nav");if(nav&&WbxMobileSite.site.config.navStyle=="topNav"){var items=nav.getElementsByTagName("li");var navWidth=nav.offsetWidth;var totalWidth=0;for(var i=0;i<items.length;i++){if(items[i].id!="topmenu-more"){totalWidth=totalWidth+items[i].offsetWidth;if(totalWidth<navWidth)WbxMobileSite.topNavItemsVisibleCount++;}}
var display=(totalWidth>navWidth)?"":"none";$("#topmenu-more").css("display",display);}},updateButtons:function(){var backBtn=document.getElementById("site-back-btn");if(backBtn)backBtn.style.display=(WbxMobileSite.site.currentPage!="p-about"&&WbxMobileSite.site.currentPage!="p-more"&&WbxMobileSite.site.history.length>0)?"":"none";var aboutBtn=document.getElementById("site-about-btn");var hasAbout=!WbxMobileSite.site.isPro()||(WbxMobileSite.site.config.aboutText!=null&&WbxMobileSite.site.config.aboutText!="")||(WbxMobileSite.site.config.aboutImg!=null&&WbxMobileSite.site.config.aboutImg!="");if(aboutBtn)aboutBtn.style.display=(hasAbout&&WbxMobileSite.site.history.length==0)?"":"none";},highlightSelectedElement:function(el){if(WbxMobileSite.site.selectedEl)this.clearSelectedElement();WbxMobileSite.site.selectedEl=el;$(WbxMobileSite.site.selectedEl).addClass("selected");},clearSelectedElement:function(){if(WbxMobileSite.site.selectedEl)$(WbxMobileSite.site.selectedEl).removeClass("selected");$(".table-view").removeClass("scroll");}},site:{config:null,pageList:[],pages:[],currentPage:null,topPage:null,currentAnimation:null,currentScroller:null,history:[],selectedEl:null,isInitialized:false,init:function(config){this.config=config;if(window.top==window.self){setTimeout(function(){document.body.addEventListener("touchmove",function(e){e.preventDefault();},false);},100);}
$("body").bind('orientationchange',WbxMobileSite.site.handleOrientationChange);this.handleOrientationChange();WbxEventLogger.init({wbx_hostname:WbxMobileSite.metricsUrl,widget_appPK:WbxMobileSite.instPk,widget_regPK:WbxMobileSite.regPk,widget_providerPK:WbxMobileSite.providerPk,widget_partnerNetworkPK:WbxMobileSite.partnerNetworkPk});this.renderSiteShell();if(config.mode!="page"){this.renderMenu();this.renderMore();this.renderNav();this.renderHeader();this.renderAbout();}else{$("body").addClass("pagemode");}
WbxMobileSite.utils.adjustNav();for(var i=0;i<this.pageList.length;i++){var pageConfig=this.config.pageConfigs[i];var page=this.pageList[i];this.pages.push(WbxMobileSite.pageFactory.getPageByType(page.type,i,pageConfig));}
if(window.top==window.self&&!window.navigator.standalone)$("body").addClass("safarifix");if(WbxMobileSite.isAndroid)$("body").addClass("ua-android");$("body").addClass("theme"+WbxMobileSite.site.config.theme);if(WbxMobileSite.isFirefox){var styleEl=document.createElement("link");styleEl.rel="stylesheet";styleEl.type="text/css";styleEl.href="/syndication/mobile/css/preview_firefox.css";document.getElementsByTagName("head")[0].appendChild(styleEl);}
if(this.pageList.length>0){if(this.config.navStyle=="menuNav"&&config.mode!="page"){WbxMobileSite.site.topPage="p-menu";}else{WbxMobileSite.site.topPage="p-0";this.renderPage(WbxMobileSite.site.topPage);}
this.setCurrentPage(WbxMobileSite.site.topPage,"instant");}
var hairextensions="";var iconUrl=(this.isPro()&&this.config.icon!=null&&this.config.icon!="")?this.config.icon:WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/mobile-site-icon.png";var startupImgUrl=WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/mobile-startup-img-basic.png";if(this.isPro()){if(this.config.startupImg!=null&&this.config.startupImg!=""){startupImgUrl=this.config.startupImg;}else{startupImgUrl=WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/mobile-startup-img.png";}}
hairextensions+='<link rel="apple-touch-icon" href="'+iconUrl+'" />';hairextensions+='<link rel="apple-touch-startup-image" href="'+startupImgUrl+'" />';$('head').append(hairextensions);if(WbxMobileSite.metricsUrl!=null)WbxEventLogger.logWidgetImpression();WbxMobileSite.utils.updateButtons();if(this.pages!=null&&this.pages.length>1)$("#p-ads").addClass(this.config.navStyle);if(window.top==window.self&&!window.navigator.standalone)$("#p-ads").addClass("safarifix");if(window.top==window.self&&(!WbxMobileSite.isIphone&&!WbxMobileSite.isAndroid&&!WbxMobileSite.isPre)){if(confirm("You are not viewing this mobile site on a supported device.\nClick OK to view the non-mobile version instead.\n")){window.location.href=WbxMobileSite.galleryUrl+"i/"+WbxMobileSite.instId;}}
this.isInitialized=true;},renderPage:function(pageKey){if(document.getElementById(pageKey)!=null)return;var page=this.getPageByPageKey(pageKey);var pageDef=this.getPageDefByPageKey(pageKey);var contentId=pageKey+"-content";var container=document.createElement("div");container.id=pageKey;container.className=pageDef.type+" site-page current";var content=document.createElement("div");content.id=contentId;content.className="page-content";container.appendChild(content);document.getElementById("site-container").appendChild(container);page.render(content,pageKey);if(WbxMobileSite.isAndroid)WbxMobileSite.site.applyWindowFixes();},applyWindowFixes:function(){var w=parseInt(window.innerWidth);var h=parseInt(window.innerHeight);$("#site-container").css("width",(w+"px"));$("#site-container").css("height",(h+"px"));var sitePageHeight=h-45;if(WbxMobileSite.site.config.navStyle=="bottomNav"){sitePageHeight=sitePageHeight-49;$("#nav").css("top",(h-49)+"px");}else if(WbxMobileSite.site.config.navStyle=="topNav"){sitePageHeight=sitePageHeight-33;}
$(".site-page").css("height",(sitePageHeight+"px"));},getPageDefByPageKey:function(pageKey){return this.pageList[this.getIndexFromPageKey(pageKey)];},getPageByPageKey:function(pageKey){return this.pages[this.getIndexFromPageKey(pageKey)];},getIndexFromPageKey:function(pageKey){return pageKey.split("-")[1];},selectNavigation:function(el,pageKey){WbxMobileSite.utils.highlightSelectedElement(el);WbxMobileSite.site.selectNavigationTab(pageKey);},selectNavigationTab:function(pageKey){if(this.config.navStyle=="bottomNav"||this.config.navStyle=="topNav"){var navListItems=document.getElementById("site-nav-list").getElementsByTagName("a");var index=parseInt(this.getIndexFromPageKey(pageKey));if(this.config.navStyle=="bottomNav"&&((index>3&&this.pageList.length>5)||(pageKey=="p-more"))){index=4;}else if(this.config.navStyle=="topNav"){index=((index>=WbxMobileSite.topNavItemsVisibleCount&&this.pageList.length>WbxMobileSite.topNavItemsVisibleCount)||(pageKey=="p-more"))?0:index+1;}
for(var i=0;i<navListItems.length;i++){var navItem=navListItems[i];if(index==i){$(navItem).addClass("enabled");}else{$(navItem).removeClass("enabled");}}}},setCurrentPage:function(pageKey,animationType){if(animationType==null)animationType="slide";WbxMobileSite.site.selectNavigationTab(pageKey);WbxMobileSite.utils.disableScrolling();WbxMobileSite.pagination.hide();var page=this.getPageByPageKey(pageKey);if(page){var parentElement=document.getElementById(pageKey+"-content");page.render(parentElement,pageKey);}
this.track(pageKey);$(".current").removeClass("current");if(animationType=="instant"){this.setCurrentPageCallback(pageKey,animationType);}else{if(typeof WebKitTransitionEvent=="object"){var toPage=$("#"+pageKey);var fromPage=(WbxMobileSite.site.currentPage!=null)?$("#"+WbxMobileSite.site.currentPage):null;if(toPage){if(fromPage){toPage.addClass("previous");}else{toPage.addClass("current");}
toPage.addClass(animationType+' in');}
if(fromPage){fromPage.one('webkitAnimationEnd',function(){$(this).removeClass('out reverse '+animationType);$(this).removeClass("slidedown-fix slidein-fix slideup-fix");WbxMobileSite.site.setCurrentPageCallback(pageKey,animationType);});$("body").addClass("transitioning");fromPage.addClass("slidedown-fix");fromPage.addClass("slidein-fix");if(animationType.indexOf("slideup")>-1&&animationType.indexOf("reverse")>-1){fromPage.addClass("slidedown-fix");}else if(animationType.indexOf("slide")>-1&&animationType.indexOf("reverse")>-1){fromPage.addClass("slidein-fix");}
fromPage.addClass("previous");fromPage.addClass(animationType+' out');}}else{WbxMobileSite.site.setCurrentPageCallback(pageKey,animationType);}}},setCurrentPageCallback:function(pageKey,animationType){var prevCurrentPage=WbxMobileSite.site.currentPage;var previousEls=$(".previous");if(previousEls)previousEls.removeClass("previous");WbxMobileSite.site.currentPage=pageKey;var toPage=$("#"+WbxMobileSite.site.currentPage);var fromPage=(prevCurrentPage!=null)?$("#"+prevCurrentPage):null;toPage.addClass("current");toPage.removeClass('in reverse '+animationType);if(fromPage)fromPage.unbind('webkitAnimationEnd');if(prevCurrentPage){if(pageKey=="p-menu"||(pageKey.split("-").length==2&&pageKey!="p-about"&&pageKey!="p-more"&&(WbxMobileSite.site.config.navStyle=="topNav"||WbxMobileSite.site.config.navStyle=="bottomNav"))){WbxMobileSite.site.history=null;WbxMobileSite.site.history=[];}else if(animationType.indexOf("reverse")==-1){WbxMobileSite.site.history.unshift({pageKey:prevCurrentPage,animationType:animationType});}}
var page=this.getPageByPageKey(pageKey);if(page){var parentElement=document.getElementById(pageKey+"-content");page.load(parentElement,pageKey);}else if(pageKey=="p-menu"||pageKey=="p-more"||pageKey=="p-about"){WbxMobileSite.utils.enableScrolling(pageKey);}
$("body").removeClass("transitioning");WbxMobileSite.utils.clearSelectedElement();WbxMobileSite.utils.updateButtons();if(WbxMobileSite.site.currentPage==WbxMobileSite.site.topPage){$(document.body).addClass("toppage");$("#p-ads").css("display","block");}else{$(document.body).removeClass("toppage");$("#p-ads").css("display","none");}},handleOrientationChange:function(){var hasScrolling=WbxMobileSite.site.currentScroller!=null;if(hasScrolling)WbxMobileSite.utils.disableScrolling();var bodyClass=(window.innerWidth<window.innerHeight)?'profile':'landscape';$("body").removeClass("profile");$("body").removeClass("landscape");$("body").addClass(bodyClass);WbxMobileSite.utils.adjustNav();if(WbxMobileSite.isAndroid)WbxMobileSite.site.applyWindowFixes();setTimeout(function(){scrollTo(0,0);if(hasScrolling)WbxMobileSite.utils.enableScrolling(WbxMobileSite.site.currentPage);},100);},handleBackBtn:function(){WbxMobileSite.utils.highlightSelectedElement(document.getElementById("site-back-btn"));return false;},handleAboutBtn:function(){WbxMobileSite.utils.highlightSelectedElement(document.getElementById("site-about-btn"));return false;},handleTouchMove:function(){$(".table-view").addClass("scroll");},handleTouchEnd:function(){$(".table-view").removeClass("scroll");},renderSiteShell:function(){var siteEl=document.createElement("div");siteEl.className="site";siteEl.id="site-container";var hdrEl=document.createElement("div");hdrEl.id="header";var navEl=document.createElement("div");navEl.id="nav";var loadingEl=document.createElement("div");loadingEl.id="loading";loadingEl.style.display="none";var loadingContent="<img src=\""+WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/activityindicator.png\" alt=\"Activityindicator\" id=\"loadingImage\" />";loadingContent+="<img src=\""+WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/activityindicator-light.png\" alt=\"Activityindicator\" id=\"loadingImage-light\" />";loadingEl.innerHTML=loadingContent;siteEl.appendChild(hdrEl);siteEl.appendChild(navEl);siteEl.appendChild(loadingEl);document.body.appendChild(siteEl);},renderNav:function(){var navList=document.createElement("ul");navList.id="site-nav-list";if(this.config.navStyle=="bottomNav"){navList.className="tabmenu";}else if(this.config.navStyle=="topNav"){navList.className="topmenu";}else{navList.className="section ";}
if(this.config.navStyle=="topNav"){var navItem=document.createElement("li");navItem.id="topmenu-more";navItem.className="more";navItem.style.right="0";navItem.style.position="absolute";navItem.style.zIndex="1";navItem.style.display="none";navItem.innerHTML="<a href=\"javascript:void(0)\" ontouchstart=\"WbxMobileSite.site.selectNavigation(this, 'p-more');\" onclick=\"return WbxMobileSite.utils.navTo('p-more', 'slideup')\"><div></div>More</a>";navList.appendChild(navItem);}
for(var i=0;i<this.pageList.length;i++){if(i<5||this.config.navStyle=="menuNav"||this.config.navStyle=="topNav"){if(this.config.navStyle=="bottomNav"&&i==4&&this.pageList.length>5){var navItem=document.createElement("li");navItem.className="more";navItem.innerHTML="<a href=\"javascript:void(0)\" ontouchstart=\"WbxMobileSite.site.selectNavigation(this, 'p-more');\" onclick=\"return WbxMobileSite.utils.navTo('p-more', 'slideup')\"><div></div>More</a>";navItem.style.width="20%";navList.appendChild(navItem);}else{var page=this.pageList[i];var pageId="p-"+i;var navItem=document.createElement("li");navItem.className=page.type.substr(1);if(this.config.navStyle=="bottomNav"||this.config.navStyle=="topNav"){navItem.innerHTML="<a href=\"javascript:void(0)\" ontouchstart=\"WbxMobileSite.site.selectNavigation(this, '"+pageId+"');\" onclick=\"return WbxMobileSite.utils.navTo('"+pageId+"', 'instant')\"><div></div><span>"+page.title+"</span></a>";}else{navItem.innerHTML="<a href=\"javascript:void(0)\" ontouchstart=\"WbxMobileSite.site.selectNavigation(this, '"+pageId+"');\" onclick=\"return WbxMobileSite.utils.navTo('"+pageId+"', 'slide')\"><div class=\"row-label\">"+page.title+"</div><div class=\"row-arrow\"></div></a>";}
if(this.config.navStyle=="bottomNav"){switch(this.pageList.length){case 1:navItem.style.width="100%";break;case 2:navItem.style.width="50%";break;case 3:navItem.style.width="33.33%";break;case 4:navItem.style.width="25%";break;default:navItem.style.width="20%";break;}}
navList.appendChild(navItem);}}}
if(this.config.navStyle=="menuNav"){var navHome=document.getElementById("p-menu-content");navHome.className="table-view grouped";navHome.appendChild(navList);}else{var navHome=document.getElementById("nav");navHome.innerHTML="";navHome.appendChild(navList);}
if(this.pageList.length>1){$('#site-container').addClass(this.config.navStyle);}else{$('#site-container').addClass("menuNav");$("#nav").css("display","none");}},renderHeader:function(){var header="<div class=\"page-title\">";if(this.config.titleStyle=="siteTitleImage"&&this.config.titleImg!=null&&this.config.titleImg!=""){header+="<img src=\""+this.config.titleImg+"\" />";}else{header+=this.config.title;}
header+="</div>";header+="<a id=\"site-back-btn\" href=\"javascript:void(0)\" onclick=\"return WbxMobileSite.utils.goBack();\" ontouchstart=\"WbxMobileSite.site.handleBackBtn()\" class=\"button back\">Back</a>";header+="<a id=\"site-prev-btn\" href=\"javascript:void(0)\" onclick=\"return WbxMobileSite.pagination.prev();\" ontouchstart=\"WbxMobileSite.utils.highlightSelectedElement('site-prev-btn')\" class=\"button prev default\">&laquo;</a>";header+="<a id=\"site-next-btn\" href=\"javascript:void(0)\" onclick=\"return WbxMobileSite.pagination.next();\" ontouchstart=\"WbxMobileSite.utils.highlightSelectedElement('site-next-btn')\" class=\"button next default\">&raquo;</a>";header+="<a id=\"site-about-btn\" href=\"javascript:void(0)\"  onclick=\"return WbxMobileSite.utils.navTo('p-about', 'slideup');\" ontouchstart=\"WbxMobileSite.site.handleAboutBtn()\" class=\"button default\">About</a>";$('#header').html(header);},renderMenu:function(){var el=document.createElement("div");el.id="p-menu";el.className="site-page";var content=document.createElement("div");content.id="p-menu-content";if(this.config.headerImg!=null&&this.config.headerImg!=""){content.innerHTML="<div class=\"menu-image\"><img src=\""+this.config.headerImg+"\" alt=\"\" class=\"\" /></div>";}
el.appendChild(content);document.getElementById("site-container").appendChild(el);},renderMore:function(){var el=document.createElement("div");el.id="p-more";el.className="site-page";var content=document.createElement("div");content.id="p-more-content";content.className="table-view";var navList=document.createElement("ul");navList.className="section";for(var i=0;i<this.pageList.length;i++){if(i>3||this.config.navStyle=="topNav"){var page=this.pageList[i];var pageId="p-"+i;var navItem=document.createElement("li");navItem.className=page.type.substr(1);navItem.innerHTML="<a href=\"javascript:void(0)\" ontouchstart=\"WbxMobileSite.site.selectNavigation(this, '"+pageId+"');\" onclick=\"return WbxMobileSite.utils.navTo('"+pageId+"', 'instant')\"><div class=\"row-label\">"+page.title+"</div><div class=\"row-arrow\"></div></a>";navList.appendChild(navItem);}}
content.appendChild(navList);var closeEl=document.createElement("a");closeEl.href="javascript:void(0)";closeEl.onclick=function(){return WbxMobileSite.utils.goBack();};closeEl.onTouchStart=function(){WbxMobileSite.utils.highlightSelectedElement(closeEl);};closeEl.className="lg-button black";closeEl.innerHTML="Close";content.appendChild(closeEl);el.appendChild(content);document.getElementById("site-container").appendChild(el);},renderAbout:function(){var el=document.createElement("div");el.id="p-about";el.className="site-page";var content="<div id=\"p-about-content\">";if(this.isPro()){content+="<div class=\"content-view grouped about\">";if(this.config.aboutImg!=null&&this.config.aboutImg!=""){var imgSrc=WbxMobileSite.utils.getProxyImageSrc(this.config.aboutImg,290,100);content+="<img src=\""+imgSrc+"\" alt=\"\" border=\"\" class=\"about-img\" /><br />";}
if(this.config.aboutText!=null&&this.config.aboutText!=""){content+=this.config.aboutText;}
content+="</div>";}else{content+="<div class=\"content-view grouped about\">";content+="<div class=\"logo\">";content+="<a href=\"http://www.widgetbox.com/\">";content+="<img src=\""+WbxMobileSite.mobileSiteRuntimeUrl+"syndication/mobile/images/about-logo-wbx.png\" width=\"206\" height=\"46\" alt=\"Logo\"/>";content+="</a>";content+="</div>";content+="<h1>This mobile site was created with Widgetbox's Mobile Site Builder.</h1>";content+="<p>Want to make your own mobile site? Design and launch a full mobile site in minutes using Widgetbox&rsquo;s Mobile Site Builder. Include a blog or feed, YouTube, Twitter, polls, and more.</p>";content+="<p>Widgetbox makes it quick and easy to create a mobile site with no programming needed.</p>";content+="</div>";content+="<a href=\"http://www.widgetbox.com/mobile/make/\" class=\"lg-button blue\" ontouchstart=\"WbxMobileSite.utils.highlightSelectedElement(this);\">Make Your Own</a>";}
content+="<a class=\"lg-button black\" href=\"javascript:void(0)\" onclick=\"return WbxMobileSite.utils.goBack()\" ontouchstart=\"WbxMobileSite.utils.highlightSelectedElement(this);\">Close</a>";content+="</div>";el.innerHTML=content;document.getElementById("site-container").appendChild(el);},isPro:function(){return WbxMobileSite.instanceServiceLevel>0;},track:function(pageKey,action,callback){if(this.isInitialized&&WbxMobileSite.metricsUrl!=null){if(pageKey=="p-about"){WbxEventLogger.logWidgetAction("click","about");}else if(pageKey=="p-more"){WbxEventLogger.logWidgetAction("click","more");}else{var page=this.getPageDefByPageKey(pageKey);if(page){if(action==null||action=="")action="click";WbxEventLogger.logWidgetAction(action,page.type);}}
if(callback)callback();}}},fetcher:{FeedFetcher:function(srcUrl){this.maxResults=10;this.ignoreImagesKeywords=[];this.srcUrl=srcUrl;this.formatJson=true;this.raw=false;this.minify=true;this.processResponse=true;WbxMobileSite.fetcher.proxyEndpoint=WbxMobileSite.proxyUrl;WbxMobileSite.fetcher.token=WbxMobileSite.token;this.fetch=function(callback){this.key=String((new Date()).getTime());var processResponse=this.processResponse;var callbackWrapper=function(data){processResponse?callback(feedProcessor.processFeed(data)):callback(data);};var callBackName="c"+WbxMobileSite.fetcher.callbacks.idCount++;WbxMobileSite.fetcher.callbacks[callBackName]=callbackWrapper;var url=WbxMobileSite.fetcher.buildUrl(this.srcUrl,this.formatJson,this.minify,this.raw,"WbxMobileSite.fetcher.callbacks."+callBackName);var scriptElement=document.createElement("script");scriptElement.setAttribute("src",url);document.getElementsByTagName("head").item(0).appendChild(scriptElement);};},proxyEndpoint:"",token:"",buildUrl:function(origin,useJson,minify,raw,callback){var url=WbxMobileSite.proxyUrl+"origin=="+escape(origin);if(minify)url+="&&minify==true";if(useJson)url+="&&json==true";if(raw)url+="&&raw==true";url+="&&callback=="+callback;if(WbxMobileSite.fetcher.token)url+="?token="+WbxMobileSite.fetcher.token;return url;},callbacks:{idCount:0}},pageFactory:{defaultPage:WbxSitePage,pageTypes:[],contains:function(type){for(var i=0;i<this.pageTypes.length;i++){var entry=this.pageTypes[i];if(entry.type==type)return true;}
return false;},register:function(type,fn){this.pageTypes.push({type:type,fn:fn});},getPageByType:function(type,index,config){for(var i=0;i<this.pageTypes.length;i++){var entry=this.pageTypes[i];if(entry.type==type){return new entry.fn(index,config);}}
return new this.defaultPage(index,config);}}};}
function WbxSitePage(index,config){}
WbxSitePage.prototype.render=function(parentEl,pageKey){};WbxSitePage.prototype.load=function(parentEl,pageKey){};var feedProcessor={contentLength:255,ignoreImagePattern:"",ignoreImagesKeywords:[],init:function(){if(this.ignoreImagesPattern){try{this.ignoreImagesKeywords=this.ignoreImagesPattern.split(",");}catch(ignore){}}},processFeed:function(data){var feed=null;var isError=this.isErrorFeed(data);if(isError){feed=this.processAtom(data,true);}else if(data.rss){feed=this.processRss(data);}else if(data.feed){feed=this.processAtom(data);}
if(feed&&feed.entries){for(var entry in feed.entries){this.extractDescriptionImages(feed.entries[entry]);}}
return feed;},clearBlacklistedImages:function(input){for(var i=0;i<this.ignoreImagesKeywords.length;i++){var keyword=trim(this.ignoreImagesKeywords[i]);if(keyword&&input.indexOf(keyword)>-1){return null;}}
return input;},processAtom:function(data,isError){var feed=data.feed;var siteUrl=(feed.link&&feed.link.length>0)?feed.link[0].href:null;var feedUrl=(feed.link&&feed.link.length>1)?feed.link[1].href:null;var title=feed.title;var description=feed.description;var lastUpdated=feed.updated;var logo=feed.logo;var returnFeed=new this.Feed(feedUrl,siteUrl,title,description,lastUpdated,logo);var feedEntries=feed.entry&&typeof feed.entry==='object'&&typeof feed.entry.length=='number'&&!(feed.entry.length.propertyIsEnumerable('length'))?feed.entry:new Array(feed.entry);if(feedEntries){for(var i=0;i<feedEntries.length;i++){var entry=feedEntries[i];returnFeed.addEntry(this.parseAtomFeedEntry(entry,isError));}}
return returnFeed;},parseAtomFeedEntry:function(entry,isError){if(entry==undefined)return null;var entryTitle=entry.title.content;var entryDate=entry.updated;var entryLink;var articleImage;var links=entry.link;for(var j=0;j<links.length;j++){var link=links[j];if(link.rel=='alternate'){if(!entryLink)entryLink=link.href;}else if(link.rel='enclosure'){if(!articleImage)articleImage=link.href;}}
var entryDesc=(isError)?entry.summary:entry.content.content;var mediaThumb=(isError)?null:entry["media:thumbnail"];var entryThumb=null;try{if(mediaThumb){entryThumb=mediaThumb.url;}}catch(e){}
var author=entry.author;return new this.FeedEntry(entryTitle,entryDesc,entryThumb,entryDate,entryLink,articleImage,author,isError);},processRss:function(data){var feed=data.rss.channel;var siteUrl=feed.link;var feedUrl=null;if(feed["atom:link"]){feedUrl=feed["atom:link"].href;}
var title=feed.title;var description=feed.description;var lastUpdated=feed.lastBuildDate;var returnFeed=new this.Feed(feedUrl,siteUrl,title,description,lastUpdated);var feedEntries=feed.item;if(feedEntries){for(var i=0;i<feedEntries.length;i++){var entry=feedEntries[i];returnFeed.addEntry(this.parseRssFeedEntry(entry,false));}}
return returnFeed;},parseRssFeedEntry:function(entry,isError){if(entry==undefined)return null;var entryTitle=entry.title;var entryDate=entry.pubDate;var entryLink=entry.link;var entryDesc=entry.description;var entryThumb=null;var imgTag=entry.image;if(imgTag){entryThumb=imgTag.url;if(!entryThumb)entryThumb=imgTag.href?imgTag.href:null;if(!entryThumb)entryThumb=imgTag.src?imgTag.src:null;}
return new this.FeedEntry(entryTitle,entryDesc,entryThumb,entryDate,entryLink,null,null,isError);},extractDescriptionImages:function(entry){if(entry==undefined)return null;if(!entry.image){var imgs=[];for(var i=0;i<imgs.length&&entry.image==null;i++){entry.image=this.clearBlacklistedImages(imgs[i].getAtribute("src"));}}},isErrorFeed:function(data){return(data&&data.feed&&data.feed.id=="urn:com.widgetbox.proxy:error-feed");},Feed:function(feedUrl,siteUrl,title,description,lastUpdated,logo){this.feedUrl=feedUrl;this.siteUrl=siteUrl;this.title=title;this.description=description;this.lastUpdated=null;if(lastUpdated)this.lastUpdated=Date.parse(lastUpdated);this.logo=logo;this.entries=[];this.addEntry=function(entry){this.entries[this.entries.length]=entry;}},FeedEntry:function(title,description,image,date,link,articleImage,author,isError){this.rawDescription=description;if(description){this.description=description;if(this.description.length>this.contentLength){this.shortDescription=this.description.substr(0,this.contentLength);var lastLessThan=this.shortDescription.lastIndexOf("<");var lastGreaterThan=this.shortDescription.lastIndexOf(">");if(lastLessThan>lastGreaterThan){this.shortDescription=this.shortDescription.substr(0,lastLessThan);}
this.shortDescription+='...';}else{this.shortDescription=this.description;}}else{this.description="";this.shortDescription="";}
this.title=title;this.image=image;if(this.image){this.image=feedProcessor.clearBlacklistedImages(this.image);}
this.articleImage=articleImage;if(this.articleImage){this.articleImage=feedProcessor.clearBlacklistedImages(this.articleImage);}
this.date=null;if(date)this.date=Date.parse(date);this.link=link;this.author=author;this.isError=isError;}};var WbxEventLogger={firstImpressionLogged:false,timesLogged:0,baseMetricsTrackingRequestUrl:null,instId:null,targetUrl:null,sessionId:null,impressionDuration:"5",adTreatmentId:null,adPartnerId:null,affiliateId:null,channelId:null,isInEditor:false,syndication_sid:"",vid:"",hover_locked:false,hover_lock_int:null,constants:{INITIAL:0,AUTO:1,MANUAL_CLICK:2,MANUAL_ROLLOVER:3,FAILED_LC:0,FAILED_NO_AD:1,HOVER:0,CLICK:1,CLOSE:2,APP_INSTANCE_ID_REQUEST_PARAM:"i",LOCATION_REQUEST_PARAM:"l",TOKEN_REQUEST_PARAM:"t",TARGET_URL_REQUEST_PARAM:"u",REDIRECT_URL_REQUEST_PARAM:"r",USE_DEFAULT_DOMAIN_REQUEST_PARAM:"udd",DEFAULT_DOMAIN_REQUEST_PARAM:"dd",SESSION_ID_REQUEST_PARAM:"sid",UNIQUE_VISITOR_ID_REQUEST_PARAM:"vid",TYPE_REQUEST_PARAM:"p",AD_IMPRESSION_DURATION_REQUEST_PARAM:"atd",AD_TREATMENT_REQUEST_PARAM:"at",AD_PARTNER_ID_REQUEST_PARAM:"api",AFFILIATE_ID_REQUEST_PARAM:"aid",CHANNEL_ID_REQUEST_PARAM:"cid",APP_INSTANCE_KEY_REQUEST_PARAM:"aik",APP_REGISTRATION_KEY_REQUEST_PARAM:"ark",APP_PROVIDER_KEY_REQUEST_PARAM:"apk",PARTNER_NETWORK_KEY_REQUEST_PARAM:"pnk",GALLERY_KEY_REQUEST_PARAM:"gk",VARIATION_REQUEST_PARAM:"v",LABEL_REQUEST_PARAM:"lbl",PAYLOAD_REQUEST_PARAM:"pl",IMPRESSION_TYPE_REQUEST_PARAM:"it",WRAPPER_TYPE:"w",USER_ID:"uid",AD_IMPRESSION_VARIATION:"adimp",AD_FAILURE_VARIATION:"adfail",AD_INTERACTION_VARIATION:"adint",PROXY_FAILURE_VARIATION:"pxfail",WIDGET_IMPRESSION_TYPE:"0",WIDGET_CLICK_TYPE:"5",WIDGET_ACTION_IMPRESSION_TYPE:"8",WRAPPER_TYPE_MOBILE:"2"},isInitialized:false,isAdServerDetailsDoneLoading:false,init:function(config){var baseURL=config["wbx_hostname"];var appInstPK=config["widget_appPK"];var appRegPK=config["widget_regPK"];var providerPK=config["widget_providerPK"];var pnPK=config["widget_partnerNetworkPK"];var galleryPK=config["widget_fromGalleryPK"];var location=window.location.href;var token=config["widget_token"];WbxEventLogger.isInEditor=window.top!=window.self;WbxEventLogger.syndication_sid=WbxEventLogger.generateGUID();WbxEventLogger.vid=WbxEventLogger.syndication_sid;var baseData={};baseData[c.APP_INSTANCE_KEY_REQUEST_PARAM]=appInstPK;if(!StringUtils.isBlank(appRegPK)){baseData[c.APP_REGISTRATION_KEY_REQUEST_PARAM]=appRegPK;}
if(!StringUtils.isBlank(providerPK)){baseData[c.APP_PROVIDER_KEY_REQUEST_PARAM]=providerPK;}
if(!StringUtils.isBlank(pnPK)){baseData[c.PARTNER_NETWORK_KEY_REQUEST_PARAM]=pnPK;}
if(!StringUtils.isBlank(galleryPK)){baseData[c.GALLERY_KEY_REQUEST_PARAM]=galleryPK;}
if(!StringUtils.isBlank(galleryPK)){baseData[c.GALLERY_KEY_REQUEST_PARAM]=galleryPK;}
baseData[c.LOCATION_REQUEST_PARAM]=location;WbxEventLogger.baseMetricsTrackingRequestUrl=URLUtils.addParameters(baseURL+"/image.gif?",baseData);WbxEventLogger.instId=config["widget_appId"];WbxEventLogger.isInitialized=true;WbxEventLogger.isAdServerDetailsDoneLoading=false;},logWidgetImpression:function(){if(!WbxEventLogger.isInEditor&&WbxEventLogger.isInitialized){var urlData={};urlData[c.SESSION_ID_REQUEST_PARAM]=WbxEventLogger.syndication_sid;urlData[c.UNIQUE_VISITOR_ID_REQUEST_PARAM]=WbxEventLogger.vid;urlData[c.IMPRESSION_TYPE_REQUEST_PARAM]=c.WIDGET_IMPRESSION_TYPE;urlData[c.WRAPPER_TYPE]=c.WRAPPER_TYPE_MOBILE;urlData[c.USER_ID]=WbxMobileSite.instCreatedByUserPk;WbxEventLogger.loadMetricsTrackerImage(URLUtils.addParameters(WbxEventLogger.baseMetricsTrackingRequestUrl,urlData));}else{}},logWidgetAction:function(label,payload){if(!WbxEventLogger.isInEditor&&WbxEventLogger.isInitialized){var urlData={};urlData[c.SESSION_ID_REQUEST_PARAM]=WbxEventLogger.syndication_sid;urlData[c.UNIQUE_VISITOR_ID_REQUEST_PARAM]=WbxEventLogger.vid;urlData[c.IMPRESSION_TYPE_REQUEST_PARAM]=c.WIDGET_ACTION_IMPRESSION_TYPE;urlData[c.LABEL_REQUEST_PARAM]=label;urlData[c.PAYLOAD_REQUEST_PARAM]=payload;WbxEventLogger.loadMetricsTrackerImage(URLUtils.addParameters(WbxEventLogger.baseMetricsTrackingRequestUrl,urlData));}else{}},getMetricsRedirectUrl:function(label,payload,targetUrl,useLinkbar){if(!WbxEventLogger.isInEditor&&WbxEventLogger.isInitialized){var urlData={};urlData[c.SESSION_ID_REQUEST_PARAM]=WbxEventLogger.syndication_sid;urlData[c.UNIQUE_VISITOR_ID_REQUEST_PARAM]=WbxEventLogger.vid;urlData[c.IMPRESSION_TYPE_REQUEST_PARAM]=c.WIDGET_CLICK_TYPE;if(targetUrl){urlData[c.TARGET_URL_REQUEST_PARAM]=targetUrl;}
if(useLinkbar){var linkbarUrl=WbxMobileSite.linkbarUrl+"?p=1";linkbarUrl+="&m="+encodeURIComponent(WbxMobileSite.site.config.title);linkbarUrl+="&mbase="+encodeURIComponent(WbxMobileSite.syndUrl);linkbarUrl+="&mtheme="+encodeURIComponent(WbxMobileSite.site.config.theme);if(WbxMobileSite.site.config.themeColor!=null&&WbxMobileSite.site.config.themeColor!=""){linkbarUrl+="&mcolor="+encodeURIComponent(WbxMobileSite.site.config.themeColor);}
linkbarUrl+="&u=";urlData[c.REDIRECT_URL_REQUEST_PARAM]=linkbarUrl;}
urlData[c.TYPE_REQUEST_PARAM]=(useLinkbar)?"1":"0";return URLUtils.addParameters(WbxEventLogger.baseMetricsTrackingRequestUrl,urlData);}else{}
return null;},loadMetricsTrackerImage:function(request){if(!WbxEventLogger.isInEditor){var logImg=document.createElement("img");logImg.src=request;logImg.style.margin="-10px 0 0 -10px";logImg.style.position="absolute";document.body.appendChild(logImg);WbxEventLogger.timesLogged++;}else{}},generateGUID:function(rfc4122){var len=(rfc4122)?36:32,chars='0123456789abcdef'.split(''),r,uuid=[];if(rfc4122){uuid[8]=uuid[13]=uuid[18]=uuid[23]='-';uuid[14]='4';}
for(var i=0;i<len;i++){if(!uuid[i]){r=0|Math.random()*16;uuid[i]=chars[(i==19)?(r&0x3)|0x8:r];}}
return uuid.join('');}};var c=WbxEventLogger.constants;var StringUtils={isBlank:function(value){return value==null||value=="";}};var URLUtils={addParameter:function(baseUrl,param,value){var seperator=(baseUrl.indexOf("?")>-1)?"&":"?";return baseUrl+seperator+param+"="+encodeURIComponent(value);},addParameters:function(baseUrl,parameters){for(var key in parameters){baseUrl=URLUtils.addParameter(baseUrl,key,parameters[key]);}
return baseUrl;}};})();function iScroll(el,scrollbars,snap){this.element=typeof el=='object'?el:document.getElementById(el);this.wrapper=this.element.parentNode;this.snap=snap;this.element.webkitTransitionProperty='-webkit-transform';this.element.style.webkitTransitionTimingFunction='cubic-bezier(0, 0, 0.2, 1)';switch(scrollbars){case'x':this.scrollbars.x={};break;case'y':this.scrollbars.y={};break;case'xy':this.scrollbars={x:{},y:{}};break;case'none':case'off':case'disabled':this.scrollbars=false;break;default:if(this.element.offsetWidth>this.wrapper.clientWidth){this.scrollbars.x={};}
if(this.element.offsetHeight>this.wrapper.clientHeight){this.scrollbars.y={};}}
if(this.scrollbars.x){this.scrollbars.x.wrapper=document.createElement('div');this.scrollbars.x.wrapper.setAttribute('style','position:absolute; z-index:100; pointer-events:none; height:5px; left:4px; right:8px; bottom:2px; overflow:hidden;');this.wrapper.appendChild(this.scrollbars.x.wrapper);this.scrollbars.x.jollyCorner=document.createElement('div');this.scrollbars.x.jollyCorner.setAttribute('style','position:absolute; z-index:110; display:none; left:4px; bottom:2px; width:3px; height:5px; background:#000; opacity:0.5;');this.wrapper.appendChild(this.scrollbars.x.jollyCorner);this.scrollbars.x.element=document.createElement('div');this.scrollbars.x.element.setAttribute('style','position:absolute; z-index:105; pointer-events:none; height:5px; background-color:#000; opacity:0; '+'-webkit-border-radius:2px; -webkit-transition-property: -webkit-transform, opacity; -webkit-transition-duration: 0, 200ms; -webkit-transition-timing-function:cubic-bezier(0.0, 0.0, 0.2, 1),ease-out; -webkit-transform:translate3d(0,0,0);');this.scrollbars.x.wrapper.appendChild(this.scrollbars.x.element);}
if(this.scrollbars.y){this.scrollbars.y.wrapper=document.createElement('div');this.scrollbars.y.wrapper.setAttribute('style','position:absolute; z-index:100; pointer-events:none; width:5px; right:2px; top:4px; bottom:8px; overflow:hidden;');this.wrapper.appendChild(this.scrollbars.y.wrapper);this.scrollbars.y.jollyCorner=document.createElement('div');this.scrollbars.y.jollyCorner.setAttribute('style','position:absolute; z-index:110; display:none; right:2px; top:4px; width:5px; height:3px; background:#000; opacity:0.5;');this.wrapper.appendChild(this.scrollbars.y.jollyCorner);this.scrollbars.y.element=document.createElement('div');this.scrollbars.y.element.setAttribute('style','position:absolute; z-index:105; pointer-events:none; width:5px; background-color:#000; opacity:0; '+'-webkit-border-radius:2px; -webkit-transition-property: -webkit-transform, opacity; -webkit-transition-duration: 0, 200ms; -webkit-transition-timing-function:cubic-bezier(0.0, 0.0, 0.2, 1),ease-out');this.scrollbars.y.wrapper.appendChild(this.scrollbars.y.element);}
this.refresh();this.element.addEventListener('touchstart',this,true);this.element.addEventListener('mousedown',this,true);}
iScroll.prototype={_xPos:0,_yPos:0,scrollX:false,scrollY:false,maxScrollX:0,maxScrollY:0,scrollbars:{},handleEvent:function(e){switch(e.type){case'mousedown':case'touchstart':this.onTouchStart(e);break;case'mousemove':case'touchmove':this.onTouchMove(e);break;case'mouseup':case'touchend':this.onTouchEnd(e);break;case'webkitTransitionEnd':this.onTransitionEnd(e);break;}},refresh:function(){this.element.style.webkitTransitionDuration='0';if(this.element.offsetWidth>this.wrapper.clientWidth){this.maxScrollX=this.wrapper.clientWidth-this.element.offsetWidth-this.element.offsetLeft;this.scrollX=true;}else{this.maxScrollX=0;this.scrollX=false;}
if(this.element.offsetHeight>this.wrapper.clientHeight){this.maxScrollY=this.wrapper.clientHeight-this.element.offsetHeight-this.element.offsetTop;this.scrollY=true;}else{this.maxScrollY=0;this.scrollY=false;}
if(this.scrollX&&this.scrollbars.x){this.scrollbars.x.size=Math.round(this.scrollbars.x.wrapper.clientWidth*(this.scrollbars.x.wrapper.clientWidth/(-this.maxScrollX+this.scrollbars.x.wrapper.clientWidth)));this.scrollbars.x.element.style.width=this.scrollbars.x.size+'px';}
if(this.scrollY&&this.scrollbars.y){this.scrollbars.y.size=Math.round(this.scrollbars.y.wrapper.clientHeight*(this.scrollbars.y.wrapper.clientHeight/(-this.maxScrollY+this.scrollbars.y.wrapper.clientHeight)));this.scrollbars.y.element.style.height=this.scrollbars.y.size+'px';}},get x(){return this._xPos;},get y(){return this._yPos;},snapPosition:function(x,y){var snapAmount=parseInt(this.element.parentNode.offsetWidth);if(isNaN(this._xPos)){if(isNaN(x))x=0;this._xPos=x;}
if(isNaN(this._yPos)){if(isNaN(y))y=0;this._yPos=y;}
var newX=Math.floor((Math.abs(this._xPos)/snapAmount))*snapAmount;if(Math.abs(x)>Math.abs(this._xPos)){if((Math.abs(this._xPos)-newX)>.1*snapAmount)newX=newX+snapAmount;}else{if((Math.abs(this._xPos)-newX)>.9*snapAmount)newX=newX-snapAmount;}
if(Math.abs(x)>=Math.abs(this.maxScrollX))newX=(-1)*this.maxScrollX;if(x<0){this._xPos=(-1)*newX;}else{this._xPos=0;}
this._yPos=0;this.element.addEventListener('webkitTransitionEnd',this,false);this.element.style.webkitTransform='translate3d('+this._xPos+'px, '+this._yPos+'px, 0)';this.element.style.webkitTransitionDuration='200ms';},setPosition:function(x,y){if(isNaN(this._xPos))this._xPos=x;if(isNaN(this._yPos))this._yPos=y;this._xPos=x!==null?x:this._xPos;this._yPos=y!==null?y:this._yPos;if(this.snap=="horizontal")this._yPos=0;this.element.style.webkitTransform='translate3d(0, '+this._yPos+'px, 0)';var sbPos;if(this.scrollX&&this.scrollbars.x){sbPos=-this._xPos*(this.scrollbars.x.wrapper.clientWidth/(this.scrollbars.x.wrapper.clientWidth-this.maxScrollX));if(sbPos+this.scrollbars.x.size>this.scrollbars.x.wrapper.clientWidth){if(this.scrollbars.x.jollyCorner.style.display=='none'){this.scrollbars.x.jollyCorner.style.left='auto';this.scrollbars.x.jollyCorner.style.right='8px';this.scrollbars.x.jollyCorner.style.webkitBorderTopRightRadius='2px';this.scrollbars.x.jollyCorner.style.webkitBorderBottomRightRadius='2px';this.scrollbars.x.jollyCorner.style.display='block';this.scrollbars.x.element.style.webkitBorderTopRightRadius='0';this.scrollbars.x.element.style.webkitBorderBottomRightRadius='0';this.scrollbars.x.wrapper.style.right='11px';}else if(sbPos+this.scrollbars.x.size<this.scrollbars.x.wrapper.clientWidth){if(this.scrollbars.x.jollyCorner.style.display=='block'){this.scrollbars.x.jollyCorner.style.display='none';this.scrollbars.x.wrapper.style.right='8px';this.scrollbars.x.element.style.webkitBorderRadius='2px';}}}else if(sbPos<0){if(this.scrollbars.x.jollyCorner.style.display=='none'){this.scrollbars.x.jollyCorner.style.left='4px';this.scrollbars.x.jollyCorner.style.right='auto';this.scrollbars.x.jollyCorner.style.webkitBorderTopLeftRadius='2px';this.scrollbars.x.jollyCorner.style.webkitBorderBottomLeftRadius='2px';this.scrollbars.x.jollyCorner.style.display='block';this.scrollbars.x.element.style.webkitBorderTopLeftRadius='0';this.scrollbars.x.element.style.webkitBorderBottomLeftRadius='0';this.scrollbars.x.wrapper.style.left='7px';}}else if(sbPos>0){if(this.scrollbars.x.jollyCorner.style.display=='block'){this.scrollbars.x.jollyCorner.style.display='none';this.scrollbars.x.wrapper.style.left='4px';this.scrollbars.x.element.style.webkitBorderRadius='2px';}}
this.scrollbars.x.element.style.webkitTransform='translate3d('+sbPos+'px, 0, 0)';}
if(this.scrollY&&this.scrollbars.y){sbPos=-this._yPos*(this.scrollbars.y.wrapper.clientHeight/(this.scrollbars.y.wrapper.clientHeight-this.maxScrollY));if(sbPos+this.scrollbars.y.size>this.scrollbars.y.wrapper.clientHeight){if(this.scrollbars.y.jollyCorner.style.display=='none'){this.scrollbars.y.jollyCorner.style.top='auto';this.scrollbars.y.jollyCorner.style.bottom='8px';this.scrollbars.y.jollyCorner.style.webkitBorderBottomLeftRadius='2px';this.scrollbars.y.jollyCorner.style.webkitBorderBottomRightRadius='2px';this.scrollbars.y.jollyCorner.style.display='block';this.scrollbars.y.element.style.webkitBorderBottomLeftRadius='0';this.scrollbars.y.element.style.webkitBorderBottomRightRadius='0';this.scrollbars.y.wrapper.style.bottom='11px';}else if(sbPos+this.scrollbars.y.size<this.scrollbars.y.wrapper.clientHeight){if(this.scrollbars.y.jollyCorner.style.display=='block'){this.scrollbars.y.jollyCorner.style.display='none';this.scrollbars.y.wrapper.style.bottom='8px';this.scrollbars.y.element.style.webkitBorderRadius='2px';}}}else if(sbPos<0){if(this.scrollbars.y.jollyCorner.style.display=='none'){this.scrollbars.y.jollyCorner.style.top='4px';this.scrollbars.y.jollyCorner.style.bottom='auto';this.scrollbars.y.jollyCorner.style.webkitBorderTopLeftRadius='2px';this.scrollbars.y.jollyCorner.style.webkitBorderTopRightRadius='2px';this.scrollbars.y.jollyCorner.style.display='block';this.scrollbars.y.element.style.webkitBorderTopLeftRadius='0';this.scrollbars.y.element.style.webkitBorderTopRightRadius='0';this.scrollbars.y.wrapper.style.top='7px';}}else if(sbPos>0){if(this.scrollbars.y.jollyCorner.style.display=='block'){this.scrollbars.y.jollyCorner.style.display='none';this.scrollbars.y.wrapper.style.top='4px';this.scrollbars.y.element.style.webkitBorderRadius='2px';}}
this.scrollbars.y.element.style.webkitTransform='translate3d(0, '+sbPos+'px, 0)';}},getEventObj:function(e){return(e.targetTouches&&e.targetTouches.length>0)?e.targetTouches[0]:e;},hasEventTarget:function(e){return e.targetTouches&&e.targetTouches.length!=1;},onTouchStart:function(e){e.preventDefault();if(this.hasEventTarget(e)){return false;}
this.element.style.webkitTransitionDuration='0';if(this.scrollbars.x){this.scrollbars.x.element.style.webkitTransitionDuration='0, 0';}
if(this.scrollbars.y){this.scrollbars.y.element.style.webkitTransitionDuration='0, 0';}
var theTransform=window.getComputedStyle(this.element).webkitTransform;theTransform=new WebKitCSSMatrix(theTransform);theTransform=new WebKitCSSMatrix(theTransform);if(theTransform.m41!=this.x||theTransform.m42!=this.y){this.setPosition(theTransform.m41,theTransform.m42);}
this.startX=this.getEventObj(e).clientX;this.startY=this.getEventObj(e).clientY;this.scrollStartX=this.x;this.scrollStartY=this.y;this.scrollStartTime=e.timeStamp;this.moved=false;var myself=this;if(window.WbxMobileSite.isAndroid){setTimeout(function(){myself.element.addEventListener('touchmove',myself,true);document.addEventListener('touchend',myself,true);myself.element.addEventListener('mousemove',myself,true);document.addEventListener('mouseup',myself,true);},100);}else{this.element.addEventListener('touchmove',this,true);document.addEventListener('touchend',this,true);this.element.addEventListener('mousemove',this,true);document.addEventListener('mouseup',this,true);}
return false;},onTouchMove:function(e){WbxMobileSite.site.handleTouchMove();e.preventDefault();if(this.hasEventTarget(e)){return false;}
var leftDelta=this.getEventObj(e).clientX-this.startX;var topDelta=this.getEventObj(e).clientY-this.startY;if(this.x>0||this.x<this.maxScrollX){leftDelta/=5;}
if(this.y>0||this.y<this.maxScrollY){topDelta/=5;}
this.setPosition(this.x+Math.round(leftDelta),this.y+Math.round(topDelta));this.startX=this.getEventObj(e).clientX;this.startY=this.getEventObj(e).clientY;this.moved=true;if(e.timeStamp-this.scrollStartTime>100){this.scrollStartX=this.x;this.scrollStartY=this.y;this.scrollStartTime=e.timeStamp;}
if(this.scrollX&&this.scrollbars.x){this.scrollbars.x.element.style.webkitTransitionDuration='0, 0';this.scrollbars.x.element.style.opacity='0.5';}
if(this.scrollY&&this.scrollbars.y){this.scrollbars.y.element.style.webkitTransitionDuration='0, 0';this.scrollbars.y.element.style.opacity='0.5';}
return false;},onTouchEnd:function(e){WbxMobileSite.site.handleTouchEnd();e.preventDefault();this.element.removeEventListener('touchmove',this,true);this.element.removeEventListener('mousemove',this,true);if(!WbxMobileSite.isAndroid){document.removeEventListener('touchend',this,true);document.removeEventListener('mouseup',this,true);}
if(!this.moved){var theEvent=document.createEvent("MouseEvents");theEvent.initEvent('click',true,false);if(e.changedTouches&&e.changedTouches.length>0)e.changedTouches[0].target.dispatchEvent(theEvent);return false;}
var deceleration=0.0075;var scrollDistanceX=this.x-this.scrollStartX;var scrollDistanceY=this.y-this.scrollStartY;var scrollDuration=e.timeStamp-this.scrollStartTime;var speedX=scrollDistanceX/scrollDuration;var speedY=scrollDistanceY/scrollDuration;if(this.x>0){var newScrollDistanceX=-this.x;var newDurationX=200;}else if(this.x<this.maxScrollX){var newScrollDistanceX=-this.x+this.maxScrollX;var newDurationX=200;}else{var newScrollDistanceX=-((speedX*speedX)/(2*deceleration));if(speedX<0&&newScrollDistanceX<this.maxScrollX-this.wrapper.clientWidth/5-this.x){newScrollDistanceX=this.maxScrollX-this.wrapper.clientWidth/5-this.x;}else if(speedX>0&&-newScrollDistanceX>this.wrapper.clientWidth/5-this.x){newScrollDistanceX=this.wrapper.clientWidth/5-this.x;}
var newDurationX=newScrollDistanceX?newScrollDistanceX/(speedX/2)*2:0;}
if(this.y>0){var newScrollDistanceY=-this.y;var newDurationY=200;}else if(this.y<this.maxScrollY){var newScrollDistanceY=-this.y+this.maxScrollY;var newDurationY=200;}else{var newScrollDistanceY=-((speedY*speedY)/(2*deceleration));if(speedY<0&&newScrollDistanceY<this.maxScrollY-this.wrapper.clientHeight/5-this.y){newScrollDistanceY=this.maxScrollY-this.wrapper.clientHeight/5-this.y;}else if(speedY>0&&-newScrollDistanceY>this.wrapper.clientHeight/5-this.y){newScrollDistanceY=this.wrapper.clientHeight/5-this.y;}
var newDurationY=newScrollDistanceY?newScrollDistanceY/(speedY/2)*2:0;}
if(newDurationX<0){newDurationX=-newDurationX;newScrollDistanceX=-newScrollDistanceX;}
if(newDurationY<0){newDurationY=-newDurationY;newScrollDistanceY=-newScrollDistanceY;}
var newPositionX=this.x+Math.round(newScrollDistanceX);var newPositionY=this.y+Math.round(newScrollDistanceY);var newDuration=newDurationX>newDurationY?newDurationX:newDurationY;if(this.x==newPositionX&&this.y==newPositionY){if(this.scrollX&&this.scrollbars.x){this.scrollbars.x.element.style.webkitTransitionDuration='0, 200ms';this.scrollbars.x.element.style.opacity='0';}
if(this.scrollY&&this.scrollbars.y){this.scrollbars.y.element.style.webkitTransitionDuration='0, 200ms';this.scrollbars.y.element.style.opacity='0';}}else{if(this.snap=="horizontal"){this.snapPosition(newPositionX,newPositionY);}else{this.scrollTo(newPositionX,newPositionY,Math.round(newDuration)+'ms');this.element.addEventListener('webkitTransitionEnd',this,false);}}
return false;},onTransitionEnd:function(){this.element.removeEventListener('webkitTransitionEnd',this,false);var resetX=resetY=null;if(this.x>0||this.x<this.maxScrollX){resetX=this.x>0?0:this.maxScrollX;}
if(this.y>0||this.y<this.maxScrollY){resetY=this.y>0?0:this.maxScrollY;}
this.scrollTo(resetX,resetY,'400ms');if(this.scrollX&&this.scrollbars.x){this.scrollbars.x.element.style.webkitTransitionDuration='0, 200ms';this.scrollbars.x.element.style.opacity='0';this.scrollbars.x.wrapper.style.left='4px';this.scrollbars.x.wrapper.style.right='8px';this.scrollbars.x.jollyCorner.style.display='none';this.scrollbars.x.jollyCorner.style.webkitBorderRadius='0';this.scrollbars.x.element.style.webkitBorderRadius='2px';}
if(this.scrollY&&this.scrollbars.y){this.scrollbars.y.element.style.webkitTransitionDuration='0, 200ms';this.scrollbars.y.element.style.opacity='0';this.scrollbars.y.wrapper.style.top='4px';this.scrollbars.y.wrapper.style.bottom='8px';this.scrollbars.y.jollyCorner.style.display='none';this.scrollbars.y.jollyCorner.style.webkitBorderRadius='0';this.scrollbars.y.element.style.webkitBorderRadius='2px';}},scrollTo:function(destX,destY,runtime){this.element.style.webkitTransitionDuration=runtime?runtime:'400ms';if(this.scrollX&&this.scrollbars.x){this.scrollbars.x.element.style.webkitTransitionDuration=this.element.style.webkitTransitionDuration+', 0';}
if(this.scrollY&&this.scrollbars.y){this.scrollbars.y.element.style.webkitTransitionDuration=this.element.style.webkitTransitionDuration+', 0';}
this.setPosition(destX,destY);if(this.x>0||this.x<this.maxScrollX||this.y>0||this.y<this.maxScrollY){this.element.addEventListener('webkitTransitionEnd',this,false);}}};if(!this.JSON){this.JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());