function MessageBox(n,t,i,r){this.settings=jQuery.extend({content:"",width:"",height:"",top:"auto",left:"auto",minTop:"15px",minLeft:"15px",context:document.body,overlayClass:"messagebox_overlay",overlayInlineCss:"position:absolute;overflow:hidden;display:none;z-index:50;",contentClass:"messagebox_content",contentInlineCss:"position:absolute;display:none;z-index:52;",loaderClass:"loader",failureClass:"failure",zIndex:50,onFail:this.onFail,callback:function(){},onShow:function(){return messageBoxAccessibility(this.contentClass,this.tabindex)},onHide:function(){return messageBoxAccessibilityHide(this.triggerElement)},dataType:"html",postData:"",async:!1,failureMsg:"Message box loading failed",animate:!0,animateTime:500,triggerElement:document.body,tabindex:0,enableTemplates:!1,template:"<div class='msgBoxTopLeft'><\/div><div class='msgBoxTopMiddle'><\/div><div class='msgBoxTopRight'><a href='/' id='closeButton'>close dialog<\/a><\/div><div class='msgBoxMiddleLeft'><\/div><div class='msgBoxMiddleMiddle'><div class='bg_map'><\/div><!--content--><\/div><div class='msgBoxMiddleRight'><\/div><div class='msgBoxBottomLeft'><\/div><div class='msgBoxBottomMiddle'><\/div><div class='msgBoxBottomRight'><\/div>"},r);this.context=jQuery(this.settings.context);this.content=this.context.find("."+this.settings.contentClass);this.overlay=this.context.find("."+this.settings.overlayClass);this.focusElement=null;this.lastFocused=null;this.settings.height=i!=""&&i!=null?i:this.settings.height;this.settings.width=t!=""&&t!=null?t:this.settings.width;allMessageBoxes.push(this);n!=""&&n!=null&&(this.settings.content=n,this.init(),this.show())}function FormDesigner(n){this.settings={node:null,buttonContainerClass:"buttonContainer",activeClass:"act",masterCheckbox:null,buttonHideClass:"btn",tempShowClass:"show",contentMargin:42,checkImageEnabled:!1,imageEnabledClass:"images_enabled",imageDisabledClass:"images_disabled",template:"<div class='button_left'><\/div>\t\t\t\t\t  <div class='button_middle'><span class='link'><!--text--><\/span><\/div>\t\t\t\t\t  <div class='button_right'><\/div>",customDropDown:!1,customDropDownClass:"btndd",dropDownTemplate:"<div class='dropdown_container'><!--itemtemplate--><\/div>",dropDownItemTemplate:"<a class='dropdown_item' href='{href}'><!--text--><\/a>",commonSelector:"formdesigner_dropdown",customSelectEvent:"customselect",customOptionFirstClass:"first",customOptionLastClass:"last",jsPositioning:!1,customScroll:!1,customScrollContentClass:"scroll_content",customScrollContainerClass:"scroll_container",customScrollerClass:"scroll_bar"};this.exception=null;this.temp=null;this.delayedFunc=null;this.imageEnabled=!0;this.scrollTop=0;this.scrollHeight=0;this.contentHeight=0;this.containerHeight=0;this.container=null;this.scroller=null;this.settings=$.extend(this.settings,n);this.settings.node!=null&&this.settings.node!=""&&this.init()}function Accessibility(n){this.settings={context:document,elements:"a,input,select,radio,checkbox,button",instructions:null,focusedClass:"focused",pointerClass:"point",toolTipWrapperId:"accessibilityToolTip",pointerWrapperId:"toolTipPointer",hasToolTipClass:"hasToolTip",imageEnabledClass:"images_enabled",imageDisabledClass:"images_disabled",pingImage:"/hsbcdotcom/images/background/ping.gif",toolTipTemplate:"<div class='tooltip'><!--text--><\/div>",labelTemplate:"<span class='tooltip-label'><\/span>",pointerTemplate:"<span class='tooltip-pointer'><\/span>",toolTipAttr:"data-tooltip",hideOnMouseMove:!0,pointOnFocus:!0,pointOnGaps:!1,handdleDynamicContent:!0,enableScrolling:!0,gapSize:200,navKey:9,enterKey:13,escKey:27,ctrlKey:17,directions:[],groups:[],rules:[],tooltips:[]};this.events={focus:"customFocus",enter:"customClick",blur:"customBlur",tab:"tabPress",esc:"escape"};this.exception=null;this.direction="";this.selectedNode=null;this.prevNode=null;this.selectedNodeNo=0;this.prevNodeNo=0;this.selectedInstructionNodeNo=0;this.navigating=!1;this.insideGroup=!1;this.lastGroup=null;this.pointerTop=0;this.pointerLeft=0;this.hasToolTip=!1;this.lastPos=0;this.instructionsReachedFromOutside=!1;this.settings=$.extend(this.settings,n)}function Carousel(n,t){if(this.settings={container:null,navigation:null,src:null,type:"slider",bannerClass:"banner",navItemHTML:"<a href='javascript:void(0)' class='navigation'><\/a>",navActiveClass:"active",animate:!0,animationType:"slide",animateTime:500,bannerGroup:1,rotateBanners:!1,autoHeight:!1,minHeight:null,maxHeight:null},this.exception=null,this.banners=null,this.wrapper=null,this.selected=0,this.bannerWidth=null,this.bannerCount=0,this.direction="right",this.moveBy=0,this.marginLeft=0,this.restore="",this.deepRestore=null,this.restoreNav="",this.deepRestoreNav=null,n!=null&&n!=""&&(this.settings.type=n),this.settings.type=="scroller")this.settings=$.extend(this.settings,{bannerWrapperClass:"bannerWrapper",moveBy:1,correction:0});this.settings=$.extend(this.settings,t);this.settings.container!=null&&this.settings.container!=""&&this.init()}function Accordian(n){this.settings={node:null,itemClass:"accordian_item",titleClass:"accordian_title",subTitleClass:"accordian_middleText",contentClass:"accordian_content",linkClass:"accordian",leftClass:"accordian_left",middleClass:"accordian_middle",rightClass:"accordian_right",titleTextClass:"accordian_text",subTitleTextClass:"accordian_middleText",iconClass:"icon",iconExpand:"expandable_icon",iconCollapse:"collapsable_icon",selfClose:!1,collapsable:!1,hideTitle:!1,hideSubTitle:!1,showIcon:!0,iconLocation:"right",selectedItem:0,clickableColumns:"all",lastClass:"last",headingLevel:"3",headingLevels:["2","3","4","5","6"]};this.childCount=0;this.settings=$.extend(this.settings,n);this.settings.node!=null&&this.settings.node!=""&&this.init()}function I18n(){this.settings={src:"",dataType:"json",page:"",method:"get"};this.vars={};this.exception=""}function DeviceIdentifierClass(n){this.settings=$.extend({mobileOnlyCssClass:"mobile-only",tabletOnlyCssClass:"tablet-only",mobileOnlyDivID:"device-mobile-only-div",tabletOnlyDivID:"device-tablet-only-div"},n);this.init()}function TextSizeChangeDetector(){this.previousSize=null;this.listeners=[];this.hasInitialized=!1}function initializeDownloadDisclaimer(){if(deviceIdentifier.isTablet()){downloadDisclaimerBox=new MessageBox;downloadDisclaimerBox.setEnableTemplates(!0);downloadDisclaimerBox.setOverlayClass("linkbox_overlay");downloadDisclaimerBox.setTemplate("<table cellpadding='0' cellspacing='0' width='100%'>\t        <tr><td class='msgBoxTopLeft'><\/td><td class='msgBoxTopMiddle' width='100%'><\/td><td class='msgBoxTopRight'><a href='/' id='closeButton' class='closeButton'>close dialog<\/a><\/td><\/tr>\t        <tr><td class='imgWhite'><\/td><td class='msgBoxMiddleMiddle'><!--content--><\/td><td class='imgWhite'><\/td><\/tr>\t        <tr><td class='msgBoxBottomLeft'><\/td><td class='msgBoxBottomMiddle'><\/td><td class='msgBoxBottomRight'><\/td><\/tr>\t        <\/table>");downloadDisclaimerBox.setContentClass("zip-link");downloadDisclaimerBox.setTop("200px");downloadDisclaimerBox.setLeft("auto");downloadDisclaimerBox.setOverlayInlineCss("");downloadDisclaimerBox.setContentInlineCss("");downloadDisclaimerBox.setContent($(".data-loader-container"));downloadDisclaimerBox.init();downloadDisclaimerBox.exception!=null&&(downloadDisclaimerBox=null)}}function handleDownloadLink(n,t,i,r,u){var e,f;downloadDisclaimerBox==null?r(u):(i.preventDefault(),e=function(){var n=$(".download-disclaimer-link"),t=new FormDesigner;t.setNode(n);t.init();n.unbind("click").bind("click",function(n){n.preventDefault();r($.extend(!0,{},u));downloadDisclaimerBox.hide()});$("a.closeButton, .pageClose").bind("click",function(n){n.preventDefault();downloadDisclaimerBox.hide()})},downloadDisclaimerBox.setCallback(e),downloadDisclaimerBox.setTriggerElement(i.target),downloadDisclaimerBox.setPostData("type="+n),downloadDisclaimerBox.load("/download-disclaimer"),downloadDisclaimerBox.show(),f=$("#accessibilityToolTip"),f.length>0&&f.remove())}function initializeCountrySelectorV2(){$(".select-country.mobile-only").each(function(n,t){t=$(t);var i="Select country",r=t.parent().prev().find("a");r.attr("data-retaindesktopbuttontext")=="1"&&(i=r.find("span.link").text());t.find("span.link").text(i)});countrySelectorV2=new MessageBox;countrySelectorV2.setEnableTemplates(!0);countrySelectorV2.setTemplate("<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='msgBoxTopLeft'><\/td><td class='msgBoxTopMiddle' width='100%'><\/td><td class='msgBoxTopRight'><a href='/' id='closeButton' class='closeButton'>close dialog<\/a><\/td><\/tr><tr><td class='imgWhite'><\/td><td class='msgBoxMiddleMiddle'><div class='bg_map'><\/div><!--content--><\/td><td class='imgWhite'><\/td><\/tr><tr><td class='msgBoxBottomLeft'><\/td><td class='msgBoxBottomMiddle'><\/td><td class='msgBoxBottomRight'><\/td><\/tr><\/table>");countrySelectorV2.setMinTop("25px");countrySelectorV2.setOverlayInlineCss("");countrySelectorV2.setContentInlineCss("");countrySelectorV2.setContent($(".data-loader-container"));countrySelectorV2.init();countrySelectorV2.exception!==null&&(countrySelectorV2=null);$(window).bind("deviceChanged",function(){countrySelectorV2!==null&&countrySelectorV2.hide()});$(".btn-select-country-2").unbind("click").bind("click",function(n){var o,i,r,e;n.preventDefault();o=function(){var n="",t=$(document).width();t>640&&t<=768?(n="msgbox_content_tablet",countryContainer=$("div.countryTablet")):t>768&&(n="messagebox_content",countryContainer=$("div.countryDesktop"));$(countrySelectorV2.content).attr("class",n);countryContainer.show();$(".countrty").unbind("click").bind("click",function(){countrySelectorV2!==null&&countrySelectorV2.hide()});$("a.closeButton, .pageClose").bind("click",function(n){n.preventDefault();countrySelectorV2.hide()})};countrySelectorV2.setCallback(o);countrySelectorV2.setTriggerElement(n.target);var u=$(this),t="",f=u.data("instructiontext");typeof f!="undefined"&&f.length>0&&(t+="InstructionText="+f);i=u.data("linkcategory");typeof i!="undefined"&&i.length>0&&(t.length>0&&(t+="&"),t+="LinkCategory="+i);r=u.data("headlinestyle");typeof r!="undefined"&&r.length>0&&(t.length>0&&(t+="&"),t+="HeadlineStyle="+r);countrySelectorV2.setPostData(t);countrySelectorV2.load("/country-selector");countrySelectorV2.show();e=$("#accessibilityToolTip");e.length>0&&e.remove()})}function getQueryStringVar(n,t){for(var u=t.split("&"),r,i=0;i<u.length;i++)if(r=u[i].split("="),r[0]==n)return r[1];return!1}function getSectionNameForWT(){return $("li.crumb:eq(2)").length>0?$("li.crumb:eq(2)").text().trim():"Homepage"}function getLinkNameForWT(n){var t="";return $(n).find("img").length>0&&$(n).find("img").first().attr("alt").length>0?t="Image: "+$(n).find("img").first().attr("alt").replace(/\s{2,}/g," "):($(n).find(".screen-reader-only").prepend(" "),t=$(n).text().trim().replace(/\s+/g," ").replace(" .",".")),t==""&&$(n).attr("title")!==undefined&&(t=$(n).attr("title")),t}function isSameDomain(n){var t=new RegExp(window.location.host+"(?!\\.)","g");return t.test(n)}function getLinkTextDataForHiddenText(n,t){for(var u=[{text:"read more"},{text:"view more"},{text:"apply now",preposition:"at"},{text:"more information"},{text:"details"},{text:"replay details"},{text:"original certificate",preposition:". "},{text:"english",preposition:". "},{text:"chinese",preposition:". "}],f=null,i,r=0;r<u.length;r++){if(i=u[r],t.indexOf(i.text)!=-1&&i.text!="english"&&i.text!="chinese")break;if(n==i.text){f=i;break}}return f}function processImageCredits(){$("img[data-image-credit]",".content-wrapper").each(function(){var t=$(this).attr("data-image-credit"),n;$(this).prev().attr("class")!="credit-line"&&(n=$('<span class="credit-line">'+t+"<\/span>"),$(this).wrap('<span class="credited-image-wrapper"><\/span>').before(n),$(this).load(function(){var t=$(this).width(),i=n.width(),r;r=t>i?t-i-10:0;n.css({"margin-left":r,width:i+"px","max-width":t-10+"px",display:"block"}).hide()}))})}function WTSearchAndFilteringTracking(){var n=$("h1").first().text().trim();$(".filter-result-info").each(function(t,i){var u,r,f,t,o,e;if(i=$(i),i.removeData(),u=i.data("fltrcount"),u&&!isNaN(u)&&u>0){for(r=["WT.tool_name"],f=i.attr("data-toolname"),f&&f.length!=0||(f=n),r.push(f),t=1;t<=u;t++)o="fltr"+t,e=i.attr("data-"+o),e&&e.length!=0||(e="not set"),r.push("WT."+o),r.push(e);r.push("WT.numReslt");r.push(i.attr("data-numreslt"));r.push("WT.fltr_pg");r.push(i.attr("data-pg"));r.push("WT.fltr_pgt");$(window).width()<=640&&i.attr("data-pgtmobile")!=undefined?r.push(i.attr("data-pgtmobile")):r.push(i.attr("data-pgt"));r.push("WT.dl");r.push("99");dcsMultiTrack.apply(window,r)}})}function processAvailableFilters(){var n=0;return $(".filter-result-info").find('select, input[type="text"]').each(function(){var i,t;if($(window).width()<=640&&$(this).attr("id")=="isin-search"||$(window).width()>640&&$(this).attr("id")=="isin-search-mobile")return!0;$(this).is("select")?(i=$(this).find("option:selected"),t=i.text().trim()):$(this).is('input[type="text"]')&&(t=$(this).val().trim(),(t==""||t=="Select date"||t=="ISIN Search")&&(t="not set"));$(".filter-result-info").attr("data-fltr"+(n+1),t);++n}),n}function RHSDynamicRelocator(n){this.updateSettings(n);var t=$("aside.related-content"),i=$("#PrimaryRHSSection");i.length>0?(this.rhsElement=i,this.isArticlePage=$("#article-page, #landing-page").length>0):t.length>0&&(this.rhsElement=t,this.isArticlePage=!1)}function downloadZip(n,t,i){if(n.length>0){var r=function(n){for(var t=n.files,i=t.length,r=[],u="zip"+(new Date).getTime(),f,e;t.length>0;)f=t.splice(0,40),e=f.join("|"),r.push(jQuery.ajax({async:!1,url:"/hsbcdotcom/webservices/UtilityWebServices/General.asmx/GetZip",type:"get",data:"total="+i+"&packageId="+u+"&fileList="+encodeURIComponent(e)}));$.when.apply(null,r).done(function(){jQuery.download("/hsbcdotcom/webservices/UtilityWebServices/General.asmx/GetZip","total="+i+"&packageId="+u+"&fileList=false")})};handleDownloadLink("zip",t,i,r,{files:n})}}function standardizeSectionHeadlineHeights(){var n=$(".main-content .content-module .main-column-2-4, .main-content .content-module .main-column-3-4, .main-content .content-module .main-column-4-4");n.each(function(n,t){var f=$(t),i=f.find(".column-1-4 .section-headline, .column-2-4 .section-headline, .column-3-4 .section-headline, .column-1-4 .article-headline, .column-2-4 .article-headline, .column-3-4 .article-headline"),u,r;i.length>1&&(i.attr("style",""),(deviceIdentifier.isDesktop()||deviceIdentifier.isTablet())&&(i=i.filter(function(n,t){var i,r,u,f;return t=$(t),i=t.prev(".image-section"),i.length>0&&(i.hasClass("thumbnail-full")||i.hasClass("thumbnail-half")||i.css("float")=="left"||i.css("float")=="right")?!1:deviceIdentifier.isTablet()?(r=t.prev(".article-headline"),r.length>0&&(u=r.prev(".image-section"),f=u.prev(".column-1-4"),u.length>0&&f.length>0))?!1:!0:!0}),u="desktop-largest-section-height",deviceIdentifier.isTablet()&&(u="tablet-largest-section-height"),r=0,f.data(u)?r=f.data(u):(i.each(function(n,t){var u=$(t),i=u.height();i>r&&(r=i)}),f.data(u,r)),i.height(r)))})}function changeHeightOfBreadcrumb(){var i=$(".breadcrumb"),n=0,t=0,r;i.find(".crumb").each(function(i,r){var f=$(r),o=f.offset(),u=o.top,e=f.outerHeight(!0)+u;i==0?n=u:u<n&&(n=u);e>t&&(t=e)});r=t-n;i.height(r)}function changeSpacingForContentModuleAfterBannerOnArticlePage(){$("#article-page")[0]&&(firstModuleInMainSection=$("#PrimaryContentSection").children().first(),$(firstModuleInMainSection).hasClass("content-module")&&$(".banner-module").addClass("without-extended-padding"))}function triggerDeviceView(){deviceIdentifier.isMobile()?hideMoreStories():showMoreStories()}function brightcoveVideoLoaded(n){var t=brightcove.api.getExperience(n);brightcoveVideoPlayers[n]=t.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);$("img.video-image").css("display","block");$("span.brightcove-video-icon").css("display","block")}function handleVideoImage(){$("img.video-image").click(function(){$(this).css("z-index","-10");$(this).next().css("z-index","-10");brightcoveVideoPlayers[$(this).parent().find("object").attr("id")].play()});$("span.brightcove-video-icon").click(function(){$(this).css("z-index","-10");$(this).prev().css("z-index","-10");brightcoveVideoPlayers[$(this).parent().find("object").attr("id")].play()})}function tickerAtGlane(){if(ticker!=null&&(ticker.reset(),ticker=null,clearInterval(n)),ticker=new Carousel("slider"),ticker.setContainer($(".ticker-area")),ticker.setBannerClass("ticker"),ticker.setRotateBanners(!0),ticker.setAnimateTime(700),ticker.setAutoHeight(!0),ticker.setMinHeight(30),ticker.init(),ticker.exception==null){var n;$(".play").unbind("click").bind("click",function(t){t.preventDefault();$(this).hasClass("play")&&!$(this).hasClass("active")&&($(".ticker").stop(!0,!0,!0),$(".pause").removeClass("active"),$(this).addClass("active"),ticker.next(),n=setInterval(function(){ticker.next()},1e4))});$(".pause").unbind("click").bind("click",function(t){t.preventDefault();$(".play").removeClass("active");$(this).addClass("active");clearInterval(n)})}$(".play").trigger("click")}function setUpDropdownGoLink(){$(".dropdown-list-link select").change(function(){$(this).parent().next().attr("href",$(this).val())})}function setMarginIfImagesOnlyInRHS(){rhsModules=$(".rhs-panel-container");rhsModules.not(":first").find(".content-panel-item").each(function(){$(this).children().length==1&&($(this).css("margin","0"),$(this).find(".image-section").css("margin","12px 0 0 0"))});firstRhsModule=rhsModules.first();firstRhsModule.length==1&&firstRhsModule.children().children().length==1&&(firstRhsModuleImageSection=firstRhsModule.find(".image-section"),firstRhsModuleImageSection.length==1&&firstRhsModule.addClass("with-image-only"))}function addIconsToImages(){$(".image-section[data-video-icon]").each(function(){videoIcon=$('<span class="'+$(this).attr("data-video-icon")+'-video-icon"><\/span>');$(this).find("img").after(videoIcon)});$(".image-section[data-youtube-icon]").each(function(){youTubeIcon=$('<span class="'+$(this).attr("data-youtube-icon")+'-youtube-icon"><span class="youtube-icon"><\/span><\/span>');$(this).find("img").before(youTubeIcon)});$(".image-section.momo, .image-section .momo").each(function(){$(this).append('<span class="lightbox-icon"><\/span>')})}function addLinkIconsToLinks(){$("a[data-link-icon]").each(function(){var n=$(this).attr("data-link-icon"),t='<span class="link-icon '+n+'"><\/span>';n=="pdf"||n=="external"||n=="facebook"||n=="googleplus"||n=="linkedin"||n=="twitter"||n=="youtube"?$(this).prepend(t):($(this).append(t),$("span.link-icon",$(this)).nowrapper())})}function addWebTrendTagsToLinks(){$("a[data-params]").each(function(){href=$(this).attr("href");params=$(this).attr("data-params");$(this).attr("href",href+"?"+params)})}function addWebTrendTagsToImages(){$(".image-section[data-params]").each(function(){var n=$("a",this),t=n.attr("href"),i=$(this).attr("data-params");n.attr("href",t+"?"+i)})}function organiseExpandableModules(){$("[data-mobile-expand]").each(function(){var n=$(this).children("div:not(.except-mobile)");$(n).length>1&&($(n).slice(1).addClass("hidden-story"),$(n).first().append('<a class="more-info" href="#"><span>'+$(this).attr("data-mobile-expand")+"<\/span><\/a>"),$(".more-info").attr("aria-expanded","false"))});$(".more-info").click(function(n){n.preventDefault();expandCaption=$(this).closest("[data-mobile-expand]").attr("data-mobile-expand");collapseCaption=$(this).closest("[data-mobile-collapse]").attr("data-mobile-collapse");$(this).closest("[data-mobile-expand]").find("div.hidden-story").slideToggle(500);$(this).find("span").each(function(n,t){t=$(t);var i=t.text();i==expandCaption?t.parent().attr("aria-expanded","true"):t.parent().attr("aria-expanded","false");t.text(i===expandCaption?collapseCaption:expandCaption)})})}function hideMoreStories(){moreInfoButton=$("a.more-info");moreInfoButton.show();$("div.hidden-story").hide()}function showMoreStories(){$("a.more-info").hide();$("div.hidden-story").show()}function SocialButtonheight(){var f=$("#social-buttons").parents(".newsroomArticle-page").length,u,n;if(f>0){var t=$("#social-buttons"),i=$("h1.title"),r=0;t.css("margin-top",0);r=parseInt(i.css("padding-top"));u=i.offset().top;n=u-t.offset().top+r;n=n+"px";t.css("margin-top",n)}}function initAccordions(){if($(".hero-tabs").length==0){var n=new Accordian;n.setNode($(".accordianWrapper"));n.setSelectedItem(0);n.setSelfClose(!0);n.setItemClass("collapsible_box");n.init()}}var allMessageBoxes,downloadDisclaimerBox,countrySelectorV2,lang,brightcoveVideoPlayers,surveyLauncherOptionsXHR;(function(n,t){function i(t,i){var u,f,e,o=t.nodeName.toLowerCase();return"area"===o?(u=t.parentNode,f=u.name,t.href&&f&&"map"===u.nodeName.toLowerCase()?(e=n("img[usemap=#"+f+"]")[0],!!e&&r(e)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&r(t)}function r(t){return n.expr.filters.visible(t)&&!n(t).parents().addBack().filter(function(){return"hidden"===n.css(this,"visibility")}).length}var u=0,f=/^ui-id-\d+$/;n.ui=n.ui||{};n.extend(n.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});n.fn.extend({focus:function(t){return function(i,r){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){n(t).focus();r&&r.call(t)},i)}):t.apply(this,arguments)}}(n.fn.focus),scrollParent:function(){var t;return t=n.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(n.css(this,"position"))&&/(auto|scroll)/.test(n.css(this,"overflow")+n.css(this,"overflow-y")+n.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(n.css(this,"overflow")+n.css(this,"overflow-y")+n.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?n(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var u,f,r=n(this[0]);r.length&&r[0]!==document;){if(u=r.css("position"),("absolute"===u||"relative"===u||"fixed"===u)&&(f=parseInt(r.css("zIndex"),10),!isNaN(f)&&0!==f))return f;r=r.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})},removeUniqueId:function(){return this.each(function(){f.test(this.id)&&n(this).removeAttr("id")})}});n.extend(n.expr[":"],{data:n.expr.createPseudo?n.expr.createPseudo(function(t){return function(i){return!!n.data(i,t)}}):function(t,i,r){return!!n.data(t,r[3])},focusable:function(t){return i(t,!isNaN(n.attr(t,"tabindex")))},tabbable:function(t){var r=n.attr(t,"tabindex"),u=isNaN(r);return(u||r>=0)&&i(t,!u)}});n("<a>").outerWidth(1).jquery||n.each(["Width","Height"],function(i,r){function u(t,i,r,u){return n.each(o,function(){i-=parseFloat(n.css(t,"padding"+this))||0;r&&(i-=parseFloat(n.css(t,"border"+this+"Width"))||0);u&&(i-=parseFloat(n.css(t,"margin"+this))||0)}),i}var o="Width"===r?["Left","Right"]:["Top","Bottom"],f=r.toLowerCase(),e={innerWidth:n.fn.innerWidth,innerHeight:n.fn.innerHeight,outerWidth:n.fn.outerWidth,outerHeight:n.fn.outerHeight};n.fn["inner"+r]=function(i){return i===t?e["inner"+r].call(this):this.each(function(){n(this).css(f,u(this,i)+"px")})};n.fn["outer"+r]=function(t,i){return"number"!=typeof t?e["outer"+r].call(this,t):this.each(function(){n(this).css(f,u(this,t,!0,i)+"px")})}});n.fn.addBack||(n.fn.addBack=function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))});n("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(n.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,n.camelCase(i)):t.call(this)}}(n.fn.removeData));n.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());n.support.selectstart="onselectstart"in document.createElement("div");n.fn.extend({disableSelection:function(){return this.bind((n.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(n){n.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});n.extend(n.ui,{plugin:{add:function(t,i,r){var u,f=n.ui[t].prototype;for(u in r)f.plugins[u]=f.plugins[u]||[],f.plugins[u].push([i,r[u]])},call:function(n,t,i){var r,u=n.plugins[t];if(u&&n.element[0].parentNode&&11!==n.element[0].parentNode.nodeType)for(r=0;u.length>r;r++)n.options[u[r][0]]&&u[r][1].apply(n.element,i)}},hasScroll:function(t,i){if("hidden"===n(t).css("overflow"))return!1;var r=i&&"left"===i?"scrollLeft":"scrollTop",u=!1;return t[r]>0?!0:(t[r]=1,u=t[r]>0,t[r]=0,u)}})})(jQuery),function(n,t){var i="ui-effects-";n.effects={effect:{}},function(n,t){function f(n,t,i){var r=h[t.type]||{};return null==n?i||!t.def?null:t.def:(n=r.floor?~~n:parseFloat(n),isNaN(n)?t.def:r.mod?(n+r.mod)%r.mod:0>n?0:n>r.max?r.max:n)}function s(f){var o=i(),s=o._rgba=[];return f=f.toLowerCase(),r(v,function(n,i){var r,h=i.re.exec(f),c=h&&i.parse(h),e=i.space||"rgba";return c?(r=o[e](c),o[u[e].cache]=r[u[e].cache],s=o._rgba=r._rgba,!1):t}),s.length?("0,0,0,0"===s.join()&&n.extend(s,e.transparent),o):e[f]}function o(n,t,i){return i=(i+1)%1,1>6*i?n+6*(t-n)*i:1>2*i?t:2>3*i?n+6*(t-n)*(2/3-i):n}var e,a=/^([\-+])=\s*(\d+\.?\d*)/,v=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[n[1],n[2],n[3],n[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(n){return[2.55*n[1],2.55*n[2],2.55*n[3],n[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(n){return[n[1],n[2]/100,n[3]/100,n[4]]}}],i=n.Color=function(t,i,r,u){return new n.Color.fn.parse(t,i,r,u)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=i.support={},l=n("<p>")[0],r=n.each;l.style.cssText="background-color:rgba(1,1,1,.5)";c.rgba=l.style.backgroundColor.indexOf("rgba")>-1;r(u,function(n,t){t.cache="_"+n;t.props.alpha={idx:3,type:"percent",def:1}});i.fn=n.extend(i.prototype,{parse:function(o,h,c,l){if(o===t)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=n(o).css(h),h=t);var a=this,v=n.type(o),y=this._rgba=[];return h!==t&&(o=[o,h,c,l],v="array"),"string"===v?this.parse(s(o)||e._default):"array"===v?(r(u.rgba.props,function(n,t){y[t.idx]=f(o[t.idx],t)}),this):"object"===v?(o instanceof i?r(u,function(n,t){o[t.cache]&&(a[t.cache]=o[t.cache].slice())}):r(u,function(t,i){var u=i.cache;r(i.props,function(n,t){if(!a[u]&&i.to){if("alpha"===n||null==o[n])return;a[u]=i.to(a._rgba)}a[u][t.idx]=f(o[n],t,!0)});a[u]&&0>n.inArray(null,a[u].slice(0,3))&&(a[u][3]=1,i.from&&(a._rgba=i.from(a[u])))}),this):t},is:function(n){var o=i(n),f=!0,e=this;return r(u,function(n,i){var s,u=o[i.cache];return u&&(s=e[i.cache]||i.to&&i.to(e._rgba)||[],r(i.props,function(n,i){return null!=u[i.idx]?f=u[i.idx]===s[i.idx]:t})),f}),f},_space:function(){var n=[],t=this;return r(u,function(i,r){t[r.cache]&&n.push(i)}),n.pop()},transition:function(n,t){var e=i(n),c=e._space(),o=u[c],l=0===this.alpha()?i("transparent"):this,a=l[o.cache]||o.to(l._rgba),s=a.slice();return e=e[o.cache],r(o.props,function(n,i){var c=i.idx,r=a[c],u=e[c],o=h[i.type]||{};null!==u&&(null===r?s[c]=u:(o.mod&&(u-r>o.mod/2?r+=o.mod:r-u>o.mod/2&&(r-=o.mod)),s[c]=f((u-r)*t+r,i)))}),this[c](s)},blend:function(t){if(1===this._rgba[3])return this;var r=this._rgba.slice(),u=r.pop(),f=i(t)._rgba;return i(n.map(r,function(n,t){return(1-u)*f[t]+u*n}))},toRgbaString:function(){var i="rgba(",t=n.map(this._rgba,function(n,t){return null==n?t>2?1:0:n});return 1===t[3]&&(t.pop(),i="rgb("),i+t.join()+")"},toHslaString:function(){var i="hsla(",t=n.map(this.hsla(),function(n,t){return null==n&&(n=t>2?1:0),t&&3>t&&(n=Math.round(100*n)+"%"),n});return 1===t[3]&&(t.pop(),i="hsl("),i+t.join()+")"},toHexString:function(t){var i=this._rgba.slice(),r=i.pop();return t&&i.push(~~(255*r)),"#"+n.map(i,function(n){return n=(n||0).toString(16),1===n.length?"0"+n:n}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}});i.fn.parse.prototype=i.fn;u.hsla.to=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var s,h,i=n[0]/255,r=n[1]/255,f=n[2]/255,c=n[3],u=Math.max(i,r,f),e=Math.min(i,r,f),t=u-e,o=u+e,l=.5*o;return s=e===u?0:i===u?60*(r-f)/t+360:r===u?60*(f-i)/t+120:60*(i-r)/t+240,h=0===t?0:.5>=l?t/o:t/(2-o),[Math.round(s)%360,h,l,null==c?1:c]};u.hsla.from=function(n){if(null==n[0]||null==n[1]||null==n[2])return[null,null,null,n[3]];var r=n[0]/360,u=n[1],t=n[2],e=n[3],i=.5>=t?t*(1+u):t+u-t*u,f=2*t-i;return[Math.round(255*o(f,i,r+1/3)),Math.round(255*o(f,i,r)),Math.round(255*o(f,i,r-1/3)),e]};r(u,function(u,e){var s=e.props,o=e.cache,h=e.to,c=e.from;i.fn[u]=function(u){if(h&&!this[o]&&(this[o]=h(this._rgba)),u===t)return this[o].slice();var l,a=n.type(u),v="array"===a||"object"===a?u:arguments,e=this[o].slice();return r(s,function(n,t){var i=v["object"===a?n:t.idx];null==i&&(i=e[t.idx]);e[t.idx]=f(i,t)}),c?(l=i(c(e)),l[o]=e,l):i(e)};r(s,function(t,r){i.fn[t]||(i.fn[t]=function(i){var f,e=n.type(i),h="alpha"===t?this._hsla?"hsla":"rgba":u,o=this[h](),s=o[r.idx];return"undefined"===e?s:("function"===e&&(i=i.call(this,s),e=n.type(i)),null==i&&r.empty?this:("string"===e&&(f=a.exec(i),f&&(i=s+parseFloat(f[2])*("+"===f[1]?1:-1))),o[r.idx]=i,this[h](o)))})})});i.hook=function(t){var u=t.split(" ");r(u,function(t,r){n.cssHooks[r]={set:function(t,u){var o,f,e="";if("transparent"!==u&&("string"!==n.type(u)||(o=s(u)))){if(u=i(o||u),!c.rgba&&1!==u._rgba[3]){for(f="backgroundColor"===r?t.parentNode:t;(""===e||"transparent"===e)&&f&&f.style;)try{e=n.css(f,"backgroundColor");f=f.parentNode}catch(h){}u=u.blend(e&&"transparent"!==e?e:"_default")}u=u.toRgbaString()}try{t.style[r]=u}catch(h){}}};n.fx.step[r]=function(t){t.colorInit||(t.start=i(t.elem,r),t.end=i(t.end),t.colorInit=!0);n.cssHooks[r].set(t.elem,t.start.transition(t.end,t.pos))}})};i.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor");n.cssHooks.borderColor={expand:function(n){var t={};return r(["Top","Right","Bottom","Left"],function(i,r){t["border"+r+"Color"]=n}),t}};e=n.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(t){var r,u,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,f={};if(i&&i.length&&i[0]&&i[i[0]])for(u=i.length;u--;)r=i[u],"string"==typeof i[r]&&(f[n.camelCase(r)]=i[r]);else for(r in i)"string"==typeof i[r]&&(f[r]=i[r]);return f}function r(t,i){var r,u,e={};for(r in i)u=i[r],t[r]!==u&&(f[r]||(n.fx.step[r]||!isNaN(parseFloat(u)))&&(e[r]=u));return e}var u=["add","remove","toggle"],f={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};n.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){n.fx.step[i]=function(n){("none"===n.end||n.setAttr)&&(1!==n.pos||n.setAttr)||(jQuery.style(n.elem,i,n.end),n.setAttr=!0)}});n.fn.addBack||(n.fn.addBack=function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))});n.effects.animateClass=function(t,f,e,o){var s=n.speed(f,e,o);return this.queue(function(){var o,e=n(this),h=e.attr("class")||"",f=s.children?e.find("*").addBack():e;f=f.map(function(){var t=n(this);return{el:t,start:i(this)}});o=function(){n.each(u,function(n,i){t[i]&&e[i+"Class"](t[i])})};o();f=f.map(function(){return this.end=i(this.el[0]),this.diff=r(this.start,this.end),this});e.attr("class",h);f=f.map(function(){var i=this,t=n.Deferred(),r=n.extend({},s,{queue:!1,complete:function(){t.resolve(i)}});return this.el.animate(this.diff,r),t.promise()});n.when.apply(n,f.get()).done(function(){o();n.each(arguments,function(){var t=this.el;n.each(this.diff,function(n){t.css(n,"")})});s.complete.call(e[0])})})};n.fn.extend({addClass:function(t){return function(i,r,u,f){return r?n.effects.animateClass.call(this,{add:i},r,u,f):t.apply(this,arguments)}}(n.fn.addClass),removeClass:function(t){return function(i,r,u,f){return arguments.length>1?n.effects.animateClass.call(this,{remove:i},r,u,f):t.apply(this,arguments)}}(n.fn.removeClass),toggleClass:function(i){return function(r,u,f,e,o){return"boolean"==typeof u||u===t?f?n.effects.animateClass.call(this,u?{add:r}:{remove:r},f,e,o):i.apply(this,arguments):n.effects.animateClass.call(this,{toggle:r},u,f,e)}}(n.fn.toggleClass),switchClass:function(t,i,r,u,f){return n.effects.animateClass.call(this,{add:i,remove:t},r,u,f)}})}(),function(){function r(t,i,r,u){return n.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),n.isFunction(i)&&(u=i,r=null,i={}),("number"==typeof i||n.fx.speeds[i])&&(u=r,r=i,i={}),n.isFunction(r)&&(u=r,r=null),i&&n.extend(t,i),r=r||i.duration,t.duration=n.fx.off?0:"number"==typeof r?r:r in n.fx.speeds?n.fx.speeds[r]:n.fx.speeds._default,t.complete=u||i.complete,t}function u(t){return!t||"number"==typeof t||n.fx.speeds[t]?!0:"string"!=typeof t||n.effects.effect[t]?n.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}n.extend(n.effects,{version:"1.10.3",save:function(n,t){for(var r=0;t.length>r;r++)null!==t[r]&&n.data(i+t[r],n[0].style[t[r]])},restore:function(n,r){for(var f,u=0;r.length>u;u++)null!==r[u]&&(f=n.data(i+r[u]),f===t&&(f=""),n.css(r[u],f))},setMode:function(n,t){return"toggle"===t&&(t=n.is(":hidden")?"show":"hide"),t},getBaseline:function(n,t){var i,r;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=n[1]/t.width}return{x:r,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},u=n("<div><\/div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),f={width:t.width(),height:t.height()},r=document.activeElement;try{r.id}catch(e){r=document.body}return t.wrap(u),(t[0]===r||n.contains(t[0],r))&&n(r).focus(),u=t.parent(),"static"===t.css("position")?(u.css({position:"relative"}),t.css({position:"relative"})):(n.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),n.each(["top","left","bottom","right"],function(n,r){i[r]=t.css(r);isNaN(parseInt(i[r],10))&&(i[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(f),u.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||n.contains(t[0],i))&&n(i).focus()),t},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){var f=t.cssUnit(i);f[0]>0&&(u[i]=f[0]*r+f[1])}),u}});n.fn.extend({effect:function(){function i(i){function f(){n.isFunction(o)&&o.call(r[0]);n.isFunction(i)&&i()}var r=n(this),o=t.complete,u=t.mode;(r.is(":hidden")?"hide"===u:"show"===u)?(r[u](),f()):e.call(r[0],t,f)}var t=r.apply(this,arguments),u=t.mode,f=t.queue,e=n.effects.effect[t.effect];return n.fx.off||!e?u?this[u](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):f===!1?this.each(i):this.queue(f||"fx",i)},show:function(n){return function(t){if(u(t))return n.apply(this,arguments);var i=r.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(n.fn.show),hide:function(n){return function(t){if(u(t))return n.apply(this,arguments);var i=r.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(n.fn.hide),toggle:function(n){return function(t){if(u(t)||"boolean"==typeof t)return n.apply(this,arguments);var i=r.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(n.fn.toggle),cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r}})}(),function(){var t={};n.each(["Quad","Cubic","Quart","Quint","Expo"],function(n,i){t[i]=function(t){return Math.pow(t,n+2)}});n.extend(t,{Sine:function(n){return 1-Math.cos(n*Math.PI/2)},Circ:function(n){return 1-Math.sqrt(1-n*n)},Elastic:function(n){return 0===n||1===n?n:-Math.pow(2,8*(n-1))*Math.sin((80*(n-1)-7.5)*Math.PI/15)},Back:function(n){return n*n*(3*n-2)},Bounce:function(n){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>n;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-n,2)}});n.each(t,function(t,i){n.easing["easeIn"+t]=i;n.easing["easeOut"+t]=function(n){return 1-i(1-n)};n.easing["easeInOut"+t]=function(n){return.5>n?i(2*n)/2:1-i(-2*n+2)/2}})}()}(jQuery),function(n){var t=/up|down|vertical/,i=/up|left|vertical|horizontal/;n.effects.effect.blind=function(r,u){var e,o,s,f=n(this),c=["position","top","bottom","left","right","height","width"],p=n.effects.setMode(f,r.mode||"hide"),w=r.direction||"up",h=t.test(w),l=h?"height":"width",a=h?"top":"left",b=i.test(w),v={},y="show"===p;f.parent().is(".ui-effects-wrapper")?n.effects.save(f.parent(),c):n.effects.save(f,c);f.show();e=n.effects.createWrapper(f).css({overflow:"hidden"});o=e[l]();s=parseFloat(e.css(a))||0;v[l]=y?o:0;b||(f.css(h?"bottom":"right",0).css(h?"top":"left","auto").css({position:"absolute"}),v[a]=y?s:o+s);y&&(e.css(l,0),b||e.css(a,s+o));e.animate(v,{duration:r.duration,easing:r.easing,queue:!1,complete:function(){"hide"===p&&f.hide();n.effects.restore(f,c);n.effects.removeWrapper(f);u()}})}}(jQuery),function(n){n.effects.effect.bounce=function(t,i){var v,f,e,r=n(this),y=["position","top","bottom","left","right","height","width"],k=n.effects.setMode(r,t.mode||"effect"),o="hide"===k,p="show"===k,h=t.direction||"up",u=t.distance,w=t.times||5,d=2*w+(p||o?1:0),c=t.duration/d,l=t.easing,s="up"===h||"down"===h?"top":"left",b="up"===h||"left"===h,a=r.queue(),g=a.length;for((p||o)&&y.push("opacity"),n.effects.save(r,y),r.show(),n.effects.createWrapper(r),u||(u=r["top"===s?"outerHeight":"outerWidth"]()/3),p&&(e={opacity:1},e[s]=0,r.css("opacity",0).css(s,b?2*-u:2*u).animate(e,c,l)),o&&(u/=Math.pow(2,w-1)),e={},e[s]=0,v=0;w>v;v++)f={},f[s]=(b?"-=":"+=")+u,r.animate(f,c,l).animate(e,c,l),u=o?2*u:u/2;o&&(f={opacity:0},f[s]=(b?"-=":"+=")+u,r.animate(f,c,l));r.queue(function(){o&&r.hide();n.effects.restore(r,y);n.effects.removeWrapper(r);i()});g>1&&a.splice.apply(a,[1,0].concat(a.splice(g,d+1)));r.dequeue()}}(jQuery),function(n){n.effects.effect.clip=function(t,i){var h,u,f,r=n(this),c=["position","top","bottom","left","right","height","width"],v=n.effects.setMode(r,t.mode||"hide"),e="show"===v,y=t.direction||"vertical",l="vertical"===y,o=l?"height":"width",a=l?"top":"left",s={};n.effects.save(r,c);r.show();h=n.effects.createWrapper(r).css({overflow:"hidden"});u="IMG"===r[0].tagName?h:r;f=u[o]();e&&(u.css(o,0),u.css(a,f/2));s[o]=e?f:0;s[a]=e?0:f/2;u.animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){e||r.hide();n.effects.restore(r,c);n.effects.removeWrapper(r);i()}})}}(jQuery),function(n){n.effects.effect.drop=function(t,i){var u,r=n(this),h=["position","top","bottom","left","right","opacity","height","width"],c=n.effects.setMode(r,t.mode||"hide"),e="show"===c,f=t.direction||"left",o="up"===f||"down"===f?"top":"left",s="up"===f||"left"===f?"pos":"neg",l={opacity:e?1:0};n.effects.save(r,h);r.show();n.effects.createWrapper(r);u=t.distance||r["top"===o?"outerHeight":"outerWidth"](!0)/2;e&&r.css("opacity",0).css(o,"pos"===s?-u:u);l[o]=(e?"pos"===s?"+=":"-=":"pos"===s?"-=":"+=")+u;r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===c&&r.hide();n.effects.restore(r,h);n.effects.removeWrapper(r);i()}})}}(jQuery),function(n){n.effects.effect.explode=function(t,i){function b(){p.push(this);p.length===o*c&&k()}function k(){r.css({visibility:"visible"});n(p).remove();u||r.hide();i()}for(var e,l,a,v,y,o=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=o,r=n(this),d=n.effects.setMode(r,t.mode||"hide"),u="show"===d,w=r.show().css("visibility","hidden").offset(),s=Math.ceil(r.outerWidth()/c),h=Math.ceil(r.outerHeight()/o),p=[],f=0;o>f;f++)for(a=w.top+f*h,y=f-(o-1)/2,e=0;c>e;e++)l=w.left+e*s,v=e-(c-1)/2,r.clone().appendTo("body").wrap("<div><\/div>").css({position:"absolute",visibility:"visible",left:-e*s,top:-f*h}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:s,height:h,left:l+(u?v*s:0),top:a+(u?y*h:0),opacity:u?0:1}).animate({left:l+(u?0:v*s),top:a+(u?0:y*h),opacity:u?1:0},t.duration||500,t.easing,b)}}(jQuery),function(n){n.effects.effect.fade=function(t,i){var r=n(this),u=n.effects.setMode(r,t.mode||"toggle");r.animate({opacity:u},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}}(jQuery),function(n){n.effects.effect.fold=function(t,i){var r,e,u=n(this),s=["position","top","bottom","left","right","height","width"],h=n.effects.setMode(u,t.mode||"hide"),o="show"===h,c="hide"===h,f=t.size||15,l=/([0-9]+)%/.exec(f),a=!!t.horizFirst,v=o!==a,y=v?["width","height"]:["height","width"],p=t.duration/2,w={},b={};n.effects.save(u,s);u.show();r=n.effects.createWrapper(u).css({overflow:"hidden"});e=v?[r.width(),r.height()]:[r.height(),r.width()];l&&(f=parseInt(l[1],10)/100*e[c?0:1]);o&&r.css(a?{height:0,width:f}:{height:f,width:0});w[y[0]]=o?e[0]:f;b[y[1]]=o?e[1]:0;r.animate(w,p,t.easing).animate(b,p,t.easing,function(){c&&u.hide();n.effects.restore(u,s);n.effects.removeWrapper(u);i()})}}(jQuery),function(n){n.effects.effect.highlight=function(t,i){var r=n(this),u=["backgroundImage","backgroundColor","opacity"],f=n.effects.setMode(r,t.mode||"show"),e={backgroundColor:r.css("backgroundColor")};"hide"===f&&(e.opacity=0);n.effects.save(r,u);r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(e,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===f&&r.hide();n.effects.restore(r,u);i()}})}}(jQuery),function(n){n.effects.effect.pulsate=function(t,i){var e,r=n(this),o=n.effects.setMode(r,t.mode||"show"),h="show"===o,a="hide"===o,v=h||"hide"===o,s=2*(t.times||5)+(v?1:0),c=t.duration/s,u=0,f=r.queue(),l=f.length;for((h||!r.is(":visible"))&&(r.css("opacity",0).show(),u=1),e=1;s>e;e++)r.animate({opacity:u},c,t.easing),u=1-u;r.animate({opacity:u},c,t.easing);r.queue(function(){a&&r.hide();i()});l>1&&f.splice.apply(f,[1,0].concat(f.splice(l,s+1)));r.dequeue()}}(jQuery),function(n){n.effects.effect.puff=function(t,i){var r=n(this),e=n.effects.setMode(r,t.mode||"hide"),o="hide"===e,s=parseInt(t.percent,10)||150,f=s/100,u={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};n.extend(t,{effect:"scale",queue:!1,fade:!0,mode:e,complete:i,percent:o?s:100,from:o?u:{height:u.height*f,width:u.width*f,outerHeight:u.outerHeight*f,outerWidth:u.outerWidth*f}});r.effect(t)};n.effects.effect.scale=function(t,i){var u=n(this),r=n.extend(!0,{},t),f=n.effects.setMode(u,t.mode||"effect"),s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===f?0:100),h=t.direction||"both",c=t.origin,e={height:u.height(),width:u.width(),outerHeight:u.outerHeight(),outerWidth:u.outerWidth()},o={y:"horizontal"!==h?s/100:1,x:"vertical"!==h?s/100:1};r.effect="size";r.queue=!1;r.complete=i;"effect"!==f&&(r.origin=c||["middle","center"],r.restore=!0);r.from=t.from||("show"===f?{height:0,width:0,outerHeight:0,outerWidth:0}:e);r.to={height:e.height*o.y,width:e.width*o.x,outerHeight:e.outerHeight*o.y,outerWidth:e.outerWidth*o.x};r.fade&&("show"===f&&(r.from.opacity=0,r.to.opacity=1),"hide"===f&&(r.from.opacity=1,r.to.opacity=0));u.effect(r)};n.effects.effect.size=function(t,i){var f,l,u,r=n(this),w=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["width","height","overflow"],v=["fontSize"],e=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],o=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],h=n.effects.setMode(r,t.mode||"effect"),y=t.restore||"effect"!==h,c=t.scale||"both",b=t.origin||["middle","center"],k=r.css("position"),s=y?w:["position","top","bottom","left","right","overflow","opacity"],p={height:0,width:0,outerHeight:0,outerWidth:0};"show"===h&&r.show();f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};"toggle"===t.mode&&"show"===h?(r.from=t.to||p,r.to=t.from||f):(r.from=t.from||("show"===h?p:f),r.to=t.to||("hide"===h?p:f));u={from:{y:r.from.height/f.height,x:r.from.width/f.width},to:{y:r.to.height/f.height,x:r.to.width/f.width}};("box"===c||"both"===c)&&(u.from.y!==u.to.y&&(s=s.concat(e),r.from=n.effects.setTransition(r,e,u.from.y,r.from),r.to=n.effects.setTransition(r,e,u.to.y,r.to)),u.from.x!==u.to.x&&(s=s.concat(o),r.from=n.effects.setTransition(r,o,u.from.x,r.from),r.to=n.effects.setTransition(r,o,u.to.x,r.to)));("content"===c||"both"===c)&&u.from.y!==u.to.y&&(s=s.concat(v).concat(a),r.from=n.effects.setTransition(r,v,u.from.y,r.from),r.to=n.effects.setTransition(r,v,u.to.y,r.to));n.effects.save(r,s);r.show();n.effects.createWrapper(r);r.css("overflow","hidden").css(r.from);b&&(l=n.effects.getBaseline(b,f),r.from.top=(f.outerHeight-r.outerHeight())*l.y,r.from.left=(f.outerWidth-r.outerWidth())*l.x,r.to.top=(f.outerHeight-r.to.outerHeight)*l.y,r.to.left=(f.outerWidth-r.to.outerWidth)*l.x);r.css(r.from);("content"===c||"both"===c)&&(e=e.concat(["marginTop","marginBottom"]).concat(v),o=o.concat(["marginLeft","marginRight"]),a=w.concat(e).concat(o),r.find("*[width]").each(function(){var i=n(this),r={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};y&&n.effects.save(i,a);i.from={height:r.height*u.from.y,width:r.width*u.from.x,outerHeight:r.outerHeight*u.from.y,outerWidth:r.outerWidth*u.from.x};i.to={height:r.height*u.to.y,width:r.width*u.to.x,outerHeight:r.height*u.to.y,outerWidth:r.width*u.to.x};u.from.y!==u.to.y&&(i.from=n.effects.setTransition(i,e,u.from.y,i.from),i.to=n.effects.setTransition(i,e,u.to.y,i.to));u.from.x!==u.to.x&&(i.from=n.effects.setTransition(i,o,u.from.x,i.from),i.to=n.effects.setTransition(i,o,u.to.x,i.to));i.css(i.from);i.animate(i.to,t.duration,t.easing,function(){y&&n.effects.restore(i,a)})}));r.animate(r.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===r.to.opacity&&r.css("opacity",r.from.opacity);"hide"===h&&r.hide();n.effects.restore(r,s);y||("static"===k?r.css({position:"relative",top:r.to.top,left:r.to.left}):n.each(["top","left"],function(n,t){r.css(t,function(t,i){var f=parseInt(i,10),u=n?r.to.left:r.to.top;return"auto"===i?u+"px":f+u+"px"})}));n.effects.removeWrapper(r);i()}})}}(jQuery),function(n){n.effects.effect.shake=function(t,i){var o,r=n(this),v=["position","top","bottom","left","right","height","width"],k=n.effects.setMode(r,t.mode||"effect"),f=t.direction||"left",s=t.distance||20,y=t.times||3,p=2*y+1,u=Math.round(t.duration/p),h="up"===f||"down"===f?"top":"left",c="up"===f||"left"===f,l={},a={},w={},e=r.queue(),b=e.length;for(n.effects.save(r,v),r.show(),n.effects.createWrapper(r),l[h]=(c?"-=":"+=")+s,a[h]=(c?"+=":"-=")+2*s,w[h]=(c?"-=":"+=")+2*s,r.animate(l,u,t.easing),o=1;y>o;o++)r.animate(a,u,t.easing).animate(w,u,t.easing);r.animate(a,u,t.easing).animate(l,u/2,t.easing).queue(function(){"hide"===k&&r.hide();n.effects.restore(r,v);n.effects.removeWrapper(r);i()});b>1&&e.splice.apply(e,[1,0].concat(e.splice(b,p+1)));r.dequeue()}}(jQuery),function(n){n.effects.effect.slide=function(t,i){var u,r=n(this),s=["position","top","bottom","left","right","width","height"],h=n.effects.setMode(r,t.mode||"show"),c="show"===h,f=t.direction||"left",e="up"===f||"down"===f?"top":"left",o="up"===f||"left"===f,l={};n.effects.save(r,s);r.show();u=t.distance||r["top"===e?"outerHeight":"outerWidth"](!0);n.effects.createWrapper(r).css({overflow:"hidden"});c&&r.css(e,o?isNaN(u)?"-"+u:-u:u);l[e]=(c?o?"+=":"-=":o?"-=":"+=")+u;r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===h&&r.hide();n.effects.restore(r,s);n.effects.removeWrapper(r);i()}})}}(jQuery),function(n){n.effects.effect.transfer=function(t,i){var u=n(this),r=n(t.to),f="fixed"===r.css("position"),e=n("body"),o=f?e.scrollTop():0,s=f?e.scrollLeft():0,h=r.offset(),l={top:h.top-o,left:h.left-s,height:r.innerHeight(),width:r.innerWidth()},c=u.offset(),a=n("<div class='ui-effects-transfer'><\/div>").appendTo(document.body).addClass(t.className).css({top:c.top-o,left:c.left-s,height:u.innerHeight(),width:u.innerWidth(),position:f?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){a.remove();i()})}}(jQuery);window.Modernizr=function(n,t,i){function l(n){c.cssText=n}function at(n,t){return l(y.join(n+";")+(t||""))}function h(n,t){return typeof n===t}function v(n,t){return!!~(""+n).indexOf(t)}function ut(n,t){var u,r;for(u in n)if(r=n[u],!v(r,"-")&&c[r]!==i)return t=="pfx"?r:!0;return!1}function vt(n,t,r){var f,u;for(f in n)if(u=t[n[f]],u!==i)return r===!1?n[f]:h(u,"function")?u.bind(r||t):u;return!1}function f(n,t,i){var r=n.charAt(0).toUpperCase()+n.slice(1),u=(n+" "+st.join(r+" ")+r).split(" ");return h(t,"string")||h(t,"undefined")?ut(u,t):(u=(n+" "+ht.join(r+" ")+r).split(" "),vt(u,t,i))}function yt(){u.input=function(i){for(var r=0,u=i.length;r<u;r++)w[i[r]]=i[r]in o;return w.list&&(w.list=!!t.createElement("datalist")&&!!n.HTMLDataListElement),w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));u.inputtypes=function(n){for(var u=0,r,f,e,h=n.length;u<h;u++)o.setAttribute("type",f=n[u]),r=o.type!=="text",r&&(o.value=g,o.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&o.style.WebkitAppearance!==i?(s.appendChild(o),e=t.defaultView,r=e.getComputedStyle&&e.getComputedStyle(o,null).WebkitAppearance!=="textfield"&&o.offsetHeight!==0,s.removeChild(o)):/^(search|tel)$/.test(f)||(r=/^(url|email)$/.test(f)?o.checkValidity&&o.checkValidity()===!1:o.value!=g)),ct[n[u]]=!!r;return ct}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var u={},d=!0,s=t.documentElement,e="modernizr",ft=t.createElement(e),c=ft.style,o=t.createElement("input"),g=":)",et={}.toString,y=" -webkit- -moz- -o- -ms- ".split(" "),ot="Webkit Moz O ms",st=ot.split(" "),ht=ot.toLowerCase().split(" "),p={svg:"http://www.w3.org/2000/svg"},r={},ct={},w={},nt=[],tt=nt.slice,b,a=function(n,i,r,u){var l,a,c,v,f=t.createElement("div"),h=t.body,o=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=u?u[r]:e+(r+1),f.appendChild(c);return l=["&#173;",'<style id="s',e,'">',n,"<\/style>"].join(""),f.id=e,(h?f:o).innerHTML+=l,o.appendChild(f),h||(o.style.background="",o.style.overflow="hidden",v=s.style.overflow,s.style.overflow="hidden",s.appendChild(o)),a=i(f,n),h?f.parentNode.removeChild(f):(o.parentNode.removeChild(o),s.style.overflow=v),!!a},pt=function(t){var i=n.matchMedia||n.msMatchMedia,r;return i?i(t).matches:(a("@media "+t+" { #"+e+" { position: absolute; } }",function(t){r=(n.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position=="absolute"}),r)},lt=function(){function n(n,u){u=u||t.createElement(r[n]||"div");n="on"+n;var f=n in u;return f||(u.setAttribute||(u=t.createElement("div")),u.setAttribute&&u.removeAttribute&&(u.setAttribute(n,""),f=h(u[n],"function"),h(u[n],"undefined")||(u[n]=i),u.removeAttribute(n))),u=null,f}var r={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return n}(),it={}.hasOwnProperty,rt,k;rt=!h(it,"undefined")&&!h(it.call,"undefined")?function(n,t){return it.call(n,t)}:function(n,t){return t in n&&h(n.constructor.prototype[t],"undefined")};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=tt.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(tt.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(tt.call(arguments)))},r});r.flexbox=function(){return f("flexWrap")};r.flexboxlegacy=function(){return f("boxDirection")};r.canvas=function(){var n=t.createElement("canvas");return!!n.getContext&&!!n.getContext("2d")};r.canvastext=function(){return!!u.canvas&&!!h(t.createElement("canvas").getContext("2d").fillText,"function")};r.webgl=function(){return!!n.WebGLRenderingContext};r.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:a(["@media (",y.join("touch-enabled),("),e,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};r.geolocation=function(){return"geolocation"in navigator};r.postmessage=function(){return!!n.postMessage};r.websqldatabase=function(){return!!n.openDatabase};r.indexedDB=function(){return!!f("indexedDB",n)};r.hashchange=function(){return lt("hashchange",n)&&(t.documentMode===i||t.documentMode>7)};r.history=function(){return!!n.history&&!!history.pushState};r.draganddrop=function(){var n=t.createElement("div");return"draggable"in n||"ondragstart"in n&&"ondrop"in n};r.websockets=function(){return"WebSocket"in n||"MozWebSocket"in n};r.rgba=function(){return l("background-color:rgba(150,255,150,.5)"),v(c.backgroundColor,"rgba")};r.hsla=function(){return l("background-color:hsla(120,40%,100%,.5)"),v(c.backgroundColor,"rgba")||v(c.backgroundColor,"hsla")};r.multiplebgs=function(){return l("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(c.background)};r.backgroundsize=function(){return f("backgroundSize")};r.borderimage=function(){return f("borderImage")};r.borderradius=function(){return f("borderRadius")};r.boxshadow=function(){return f("boxShadow")};r.textshadow=function(){return t.createElement("div").style.textShadow===""};r.opacity=function(){return at("opacity:.55"),/^0.55$/.test(c.opacity)};r.cssanimations=function(){return f("animationName")};r.csscolumns=function(){return f("columnCount")};r.cssgradients=function(){var n="background-image:";return l((n+"-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));"+n)+y.join("linear-gradient(left top,#9f9, white);"+n)).slice(0,-n.length)),v(c.backgroundImage,"gradient")};r.cssreflections=function(){return f("boxReflect")};r.csstransforms=function(){return!!f("transform")};r.csstransforms3d=function(){var n=!!f("perspective");return n&&"webkitPerspective"in s.style&&a("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t){n=t.offsetLeft===9&&t.offsetHeight===3}),n};r.csstransitions=function(){return f("transition")};r.fontface=function(){var n;return a('@font-face {font-family:"font";src:url("https://")}',function(i,r){var f=t.getElementById("smodernizr"),u=f.sheet||f.styleSheet,e=u?u.cssRules&&u.cssRules[0]?u.cssRules[0].cssText:u.cssText||"":"";n=/src/i.test(e)&&e.indexOf(r.split(" ")[0])===0}),n};r.generatedcontent=function(){var n;return a(["#",e,"{font:0/0 a}#",e,':after{content:"',g,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){n=t.offsetHeight>=3}),n};r.video=function(){var i=t.createElement("video"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),n.h264=i.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),n.webm=i.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(r){}return n};r.audio=function(){var i=t.createElement("audio"),n=!1;try{(n=!!i.canPlayType)&&(n=new Boolean(n),n.ogg=i.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=i.canPlayType("audio/mpeg;").replace(/^no$/,""),n.wav=i.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(i.canPlayType("audio/x-m4a;")||i.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(r){}return n};r.localstorage=function(){try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(n){return!1}};r.sessionstorage=function(){try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(n){return!1}};r.webworkers=function(){return!!n.Worker};r.applicationcache=function(){return!!n.applicationCache};r.svg=function(){return!!t.createElementNS&&!!t.createElementNS(p.svg,"svg").createSVGRect};r.inlinesvg=function(){var n=t.createElement("div");return n.innerHTML="<svg/>",(n.firstChild&&n.firstChild.namespaceURI)==p.svg};r.smil=function(){return!!t.createElementNS&&/SVGAnimate/.test(et.call(t.createElementNS(p.svg,"animate")))};r.svgclippaths=function(){return!!t.createElementNS&&/SVGClipPath/.test(et.call(t.createElementNS(p.svg,"clipPath")))};for(k in r)rt(r,k)&&(b=k.toLowerCase(),u[b]=r[k](),nt.push((u[b]?"":"no-")+b));return u.input||yt(),u.addTest=function(n,t){if(typeof n=="object")for(var r in n)rt(n,r)&&u.addTest(r,n[r]);else{if(n=n.toLowerCase(),u[n]!==i)return u;t=typeof t=="function"?t():t;typeof d!="undefined"&&d&&(s.className+=" "+(t?"":"no-")+n);u[n]=t}return u},l(""),ft=o=null,u._version="2.6.2",u._prefixes=y,u._domPrefixes=ht,u._cssomPrefixes=st,u.mq=pt,u.hasEvent=lt,u.testProp=function(n){return ut([n])},u.testAllProps=f,u.testStyles=a,s.className=s.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(d?" js "+nt.join(" "):""),u}(this,this.document),function(n,t){function c(n,t){var i=n.createElement("p"),r=n.getElementsByTagName("head")[0]||n.documentElement;return i.innerHTML="x<style>"+t+"<\/style>",r.insertBefore(i.lastChild,r.firstChild)}function u(){var n=i.elements;return typeof n=="string"?n.split(" "):n}function f(n){var t=p[n[y]];return t||(t={},h++,n[y]=h,p[h]=t),t}function l(n,i,u){if(i||(i=t),r)return i.createElement(n);u||(u=f(i));var e;return e=u.cache[n]?u.cache[n].cloneNode():it.test(n)?(u.cache[n]=u.createElem(n)).cloneNode():u.createElem(n),e.canHaveChildren&&!tt.test(n)?u.frag.appendChild(e):e}function w(n,i){if(n||(n=t),r)return n.createDocumentFragment();i=i||f(n);for(var o=i.frag.cloneNode(),e=0,s=u(),h=s.length;e<h;e++)o.createElement(s[e]);return o}function b(n,t){t.cache||(t.cache={},t.createElem=n.createElement,t.createFrag=n.createDocumentFragment,t.frag=t.createFrag());n.createElement=function(r){return i.shivMethods?l(r,n,t):t.createElem(r)};n.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+u().join().replace(/\w+/g,function(n){return t.createElem(n),t.frag.createElement(n),'c("'+n+'")'})+");return n}")(i,t.frag)}function a(n){n||(n=t);var u=f(n);return i.shivCSS&&!s&&!u.hasCSS&&(u.hasCSS=!!c(n,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),r||b(n,u),n}function k(n){for(var t,i=n.getElementsByTagName("*"),r=i.length,e=RegExp("^(?:"+u().join("|")+")$","i"),f=[];r--;)t=i[r],e.test(t.nodeName)&&f.push(t.applyElement(d(t)));return f}function d(n){for(var t,r=n.attributes,u=r.length,i=n.ownerDocument.createElement(e+":"+n.nodeName);u--;)t=r[u],t.specified&&i.setAttribute(t.nodeName,t.nodeValue);return i.style.cssText=n.style.cssText,i}function g(n){for(var t,i=n.split("{"),r=i.length,f=RegExp("(^|[\\s,>+~])("+u().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),o="$1"+e+"\\:$2";r--;)t=i[r]=i[r].split("}"),t[t.length-1]=t[t.length-1].replace(f,o),i[r]=t.join("}");return i.join("{")}function nt(n){for(var t=n.length;t--;)n[t].removeNode()}function v(n){function r(){clearTimeout(i._removeSheetTimer);t&&t.removeNode(!0);t=null}var t,u,i=f(n),o=n.namespaces,s=n.parentWindow;return!ut||n.printShived?n:(typeof o[e]=="undefined"&&o.add(e),s.attachEvent("onbeforeprint",function(){r();for(var o,s,f,l=n.styleSheets,e=[],i=l.length,h=Array(i);i--;)h[i]=l[i];while(f=h.pop())if(!f.disabled&&rt.test(f.media)){try{o=f.imports;s=o.length}catch(a){s=0}for(i=0;i<s;i++)h.push(o[i]);try{e.push(f.cssText)}catch(a){}}e=g(e.reverse().join(""));u=k(n);t=c(n,e)}),s.attachEvent("onafterprint",function(){nt(u);clearTimeout(i._removeSheetTimer);i._removeSheetTimer=setTimeout(r,500)}),n.printShived=!0,n)}var o=n.html5||{},tt=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,it=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,s,y="_html5shiv",h=0,p={},r,i;(function(){try{var n=t.createElement("a");n.innerHTML="<xyz><\/xyz>";s="hidden"in n;r=n.childNodes.length==1||function(){t.createElement("a");var n=t.createDocumentFragment();return typeof n.cloneNode=="undefined"||typeof n.createDocumentFragment=="undefined"||typeof n.createElement=="undefined"}()}catch(i){s=!0;r=!0}})();i={elements:o.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:o.shivCSS!==!1,supportsUnknownElements:r,shivMethods:o.shivMethods!==!1,type:"default",shivDocument:a,createElement:l,createDocumentFragment:w};n.html5=i;a(t);var rt=/^$|\b(?:all|print)\b/,e="html5shiv",ut=!r&&function(){var i=t.documentElement;return typeof t.namespaces!="undefined"&&typeof t.parentWindow!="undefined"&&typeof i.applyElement!="undefined"&&typeof i.removeNode!="undefined"&&typeof n.attachEvent!="undefined"}();i.type+=" print";i.shivPrint=v;v(t)}(this,document),function(n,t,i){function h(n){return"[object Function]"==y.call(n)}function c(n){return"string"==typeof n}function l(){}function w(n){return!n||"loaded"==n||"complete"==n||"uninitialized"==n}function e(){var n=a.shift();v=1;n?n.t?s(function(){("c"==n.t?u.injectCss:u.injectJs)(n.s,0,n.a,n.x,n.e,1)},0):(n(),e()):v=0}function ut(n,i,f,h,c,l,y){function k(t){if(!nt&&w(p.readyState)&&(tt.r=nt=1,!v&&e(),p.onload=p.onreadystatechange=null,t)){"img"!=n&&s(function(){g.removeChild(p)},50);for(var u in r[i])r[i].hasOwnProperty(u)&&r[i][u].onload()}}var y=y||u.errorTimeout,p=t.createElement(n),nt=0,b=0,tt={t:f,s:i,e:c,a:l,x:y};1===r[i]&&(b=1,r[i]=[]);"object"==n?p.data=i:(p.src=i,p.type=n);p.width=p.height="0";p.onerror=p.onload=p.onreadystatechange=function(){k.call(this,b)};a.splice(h,0,tt);"img"!=n&&(b||2===r[i]?(g.insertBefore(p,d?null:o),s(k,y)):r[i].push(p))}function ft(n,t,i,r,u){return v=0,t=t||"j",c(n)?ut("c"==t?et:nt,n,t,this.i++,i,r,u):(a.splice(this.i++,0,n),1==a.length&&e()),this}function b(){var n=u;return n.loader={load:ft,i:0},n}var f=t.documentElement,s=n.setTimeout,o=t.getElementsByTagName("script")[0],y={}.toString,a=[],v=0,k="MozAppearance"in f.style,d=k&&!!t.createRange().compareNode,g=d?f:o.parentNode,f=n.opera&&"[object Opera]"==y.call(n.opera),f=!!t.attachEvent&&!f,nt=k?"object":f?"script":"img",et=f?"script":nt,tt=Array.isArray||function(n){return"[object Array]"==y.call(n)},p=[],r={},it={timeout:function(n,t){return t.length&&(n.timeout=t[0]),n}},rt,u;u=function(n){function a(n){for(var n=n.split("!"),f=p.length,t=n.pop(),e=n.length,t={url:t,origUrl:t,prefixes:n},u,r,i=0;i<e;i++)r=n[i].split("="),(u=it[r.shift()])&&(t=u(t,r));for(i=0;i<f;i++)t=p[i](t);return t}function f(n,t,u,f,e){var o=a(n),s=o.autoCallback;o.url.split(".").pop().split("?").shift();o.bypass||(t&&(t=h(t)?t:t[n]||t[f]||t[n.split("/").pop().split("?")[0]]),o.instead?o.instead(n,t,u,f,e):(r[o.url]?o.noexec=!0:r[o.url]=1,u.load(o.url,o.forceCSS||!o.forceJS&&"css"==o.url.split(".").pop().split("?").shift()?"c":i,o.noexec,o.attrs,o.timeout),(h(t)||h(s))&&u.load(function(){b();t&&t(o.origUrl,e,f);s&&s(o.origUrl,e,f);r[o.url]=2})))}function s(n,t){function a(n,o){if(n){if(c(n))o||(i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}),f(n,i,t,0,e);else if(Object(n)===n)for(r in v=function(){var t=0,i;for(i in n)n.hasOwnProperty(i)&&t++;return t}(),n)n.hasOwnProperty(r)&&(!o&&!--v&&(h(i)?i=function(){var n=[].slice.call(arguments);s.apply(this,n);u()}:i[r]=function(n){return function(){var t=[].slice.call(arguments);n&&n.apply(this,t);u()}}(s[r])),f(n[r],i,t,r,e))}else o||u()}var e=!!n.test,o=n.load||n.both,i=n.callback||l,s=i,u=n.complete||l,v,r;a(e?n.yep:n.nope,!!o);o&&a(o)}var e,t,o=this.yepnope.loader;if(c(n))f(n,0,o,0);else if(tt(n))for(e=0;e<n.length;e++)t=n[e],c(t)?f(t,0,o,0):tt(t)?u(t):Object(t)===t&&s(t,o);else Object(n)===n&&s(n,o)};u.addPrefix=function(n,t){it[n]=t};u.addFilter=function(n){p.push(n)};u.errorTimeout=1e4;null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",rt=function(){t.removeEventListener("DOMContentLoaded",rt,0);t.readyState="complete"},0));n.yepnope=b();n.yepnope.executeStack=e;n.yepnope.injectJs=function(n,i,r,f,h,c){var a=t.createElement("script"),v,y,f=f||u.errorTimeout;a.src=n;for(y in r)a.setAttribute(y,r[y]);i=c?e:i||l;a.onreadystatechange=a.onload=function(){!v&&w(a.readyState)&&(v=1,i(),a.onload=a.onreadystatechange=null)};s(function(){v||(v=1,i(1))},f);h?a.onload():o.parentNode.insertBefore(a,o)};n.yepnope.injectCss=function(n,i,r,u,f,h){var u=t.createElement("link"),c,i=h?e:i||l;u.href=n;u.rel="stylesheet";u.type="text/css";for(c in r)u.setAttribute(c,r[c]);f||(o.parentNode.insertBefore(u,o),s(i,0))}}(this,document);Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))},function(n){n.lightbox=function(t){function f(){i.css({top:e(),left:(n(window).width()-i.width())/2})}function e(){var r=n(window).scrollTop()+20;return i.height()<n(window).height()&&(t.windowTop||(r+=(n(window).height()-i.height())/2)),r}function u(){i.trigger("oncloselightbox");t.remove?(r.remove(),i.remove()):(r.hide(),i.hide())}var r,i;return t=n.extend(!0,{content:"",classes:{overlay:"overlay",lightbox:"lightbox",close:"close"},windowTop:!1,closeContent:"",remove:!0,addTabFocusElement:!0},t),r=n('<div class="'+t.classes.overlay+'" />').appendTo(document.body).css({height:n(document).height(),width:n(document).width()}).click(function(){u()}),n(window).resize(function(){r.css({height:n(document).height(),width:n(document).width()})}),i=n('<div class="'+t.classes.lightbox+'"><div class="lightboxInner1"><div class="lightboxInner2">'+t.content+"<\/div><\/div><\/div>").appendTo(document.body).bind("closelightbox",function(){u()}).bind("resizelightbox",function(n,t,r){i.width(t);i.height(r);f();i.trigger("onresizelightbox")}),t.addTabFocusElement&&n('<span class="tabbableElement" tabindex="1"><\/span>').prependTo(i).focus(),i.trigger("onopenlightbox").find("."+t.classes.close).click(function(n){n.preventDefault();u()}),n('<a href="#" class="'+t.classes.close+'">'+t.closeContent+"<\/a>").prependTo(i).click(function(n){n.preventDefault();u()}),f(),i}}(jQuery),function(n){var t;(function(n){typeof module!="undefined"?module.exports=n:typeof define=="function"?define(n):t=n})(function(){function it(n,t){return RegExp.prototype.test.call(n,t)}function h(n){return!it(g,n)}function r(n){var t=n.replace(c,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)});return'"'+t+'"'}function o(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function a(n){return String(n).replace(/[&<>"'\/]/g,function(n){return l[n]})}function u(n){this.string=n;this.tail=n;this.pos=0}function i(n,t){this.view=n;this.parent=t;this.clearCache()}function t(){this.clearCache()}function v(n,t){for(var u=['""'],i,e,o,f=0,s=n.length;f<s;++f){i=n[f];switch(i.type){case"#":case"^":e=i.type==="#"?"_section":"_inverted";u.push("r."+e+"("+r(i.value)+", c, function (c, r) {\n  "+v(i.tokens,!0)+"\n})");break;case"{":case"&":case"name":o=i.type==="name"?"true":"false";u.push("r._name("+r(i.value)+", c, "+o+")");break;case">":u.push("r._partial("+r(i.value)+", c)");break;case"text":u.push(r(i.value))}}return(u="return "+u.join(" + ")+";",t)?u:new Function("c, r",u)}function y(n){if(n.length===2)return[new RegExp(o(n[0])+"\\s*"),new RegExp("\\s*"+o(n[1]))];throw new Error("Invalid tags: "+n.join(" "));}function rt(n){for(var e=[],u=e,i=[],t,r,f=0;f<n.length;++f){t=n[f];switch(t.type){case"#":case"^":t.tokens=[];i.push(t);u.push(t);u=t.tokens;break;case"/":if(i.length===0)throw new Error("Unopened section: "+t.value);if(r=i.pop(),r.value!==t.value)throw new Error("Unclosed section: "+r.value);u=i.length>0?i[i.length-1].tokens:e;break;default:u.push(t)}}if(r=i.pop(),r)throw new Error("Unclosed section: "+r.value);return e}function ut(n){for(var i,r,t=0;t<n.length;++t)r=n[t],i&&i.type==="text"&&r.type==="text"?(i.value+=r.value,n.splice(t--,1)):i=r}function p(t,i){var w,g,it;i=i||n.tags;for(var c=y(i),r=new u(t),l=[],a=[],b=!1,v=!1,ft=function(){if(b&&!v)while(a.length)l.splice(a.pop(),1);else a=[];b=!1;v=!1},e,f,p;!r.eos();){if(f=r.scanUntil(c[0]),f)for(w=0,g=f.length;w<g;++w)p=f.charAt(w),h(p)?a.push(l.length):v=!0,l.push({type:"text",value:p}),p==="\n"&&ft();if(!r.scan(c[0]))break;if(b=!0,e=r.scan(tt)||"name",r.scan(k),e==="="?(f=r.scanUntil(s),r.scan(s),r.scanUntil(c[1])):e==="{"?(it=new RegExp("\\s*"+o("}"+i[1])),f=r.scanUntil(it),r.scan(nt),r.scanUntil(c[1])):f=r.scanUntil(c[1]),!r.scan(c[1]))throw new Error("Unclosed tag at "+r.pos);l.push({type:e,value:f});(e==="name"||e==="{"||e==="&")&&(v=!0);e==="="&&(i=f.split(d),c=y(i))}return ut(l),rt(l)}function ft(){f.clearCache()}function et(n,t){return f.compile(n,t)}function w(n,t,i){return f.compilePartial(n,t,i)}function b(n,t,i){if(i)for(var r in i)w(r,i[r]);return f.render(n,t)}var n={},e,c,l,f;n.name="mustache.js";n.version="0.5.2";n.tags=["{{","}}"];n.parse=p;n.clearCache=ft;n.compile=et;n.compilePartial=w;n.render=b;n.Scanner=u;n.Context=i;n.Renderer=t;n.to_html=function(n,t,i,r){var u=b(n,t,i);if(typeof r=="function")r(u);else return u};var k=/\s*/,d=/\s+/,g=/\S/,s=/\s*=/,nt=/\s*\}/,tt=/#|\^|\/|>|\{|&|=|!/;return e=Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},c=/[\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF\u2028\u2029]/gm,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},n.isWhitespace=h,n.isArray=e,n.quote=r,n.escapeRe=o,n.escapeHtml=a,u.prototype.eos=function(){return this.tail===""},u.prototype.scan=function(n){var t=this.tail.match(n);return t&&t.index===0?(this.tail=this.tail.substring(t[0].length),this.pos+=t[0].length,t[0]):""},u.prototype.scanUntil=function(n){var t,i=this.tail.search(n);switch(i){case-1:t=this.tail;this.pos+=this.tail.length;this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i);this.tail=this.tail.substring(i);this.pos+=i}return t},i.make=function(n){return n instanceof i?n:new i(n)},i.prototype.clearCache=function(){this._cache={}},i.prototype.push=function(n){return new i(n,this)},i.prototype.lookup=function(n){var t=this._cache[n],i,r,u;if(!t){if(n===".")t=this.view;else for(i=this;i;){if(n.indexOf(".")>0)for(r=n.split("."),u=0,t=i.view;t&&u<r.length;)t=t[r[u++]];else t=i.view[n];if(t!=null)break;i=i.parent}this._cache[n]=t}return typeof t=="function"&&(t=t.call(this.view)),t},t.prototype.clearCache=function(){this._cache={};this._partialCache={}},t.prototype.compile=function(n,t){typeof n=="string"&&(n=p(n,t));var r=v(n),u=this;return function(n){return r(i.make(n),u)}},t.prototype.compilePartial=function(n,t,i){return this._partialCache[n]=this.compile(t,i),this._partialCache[n]},t.prototype.render=function(n,t){var i=this._cache[n];return i||(i=this.compile(n),this._cache[n]=i),i(t)},t.prototype._section=function(n,t,i){var r=t.lookup(n),f,u,o;switch(typeof r){case"object":if(e(r)){for(f="",u=0,o=r.length;u<o;++u)f+=i(t.push(r[u]),this);return f}return r?i(t.push(r),this):"";case"function":var s=i(t,this),h=this,c=function(n){return h.render(n,t)};return r.call(t.view,s,c)||"";default:if(r)return i(t,this)}return""},t.prototype._inverted=function(n,t,i){var r=t.lookup(n);return r==null||r===!1||e(r)&&r.length===0?i(t,this):""},t.prototype._partial=function(n,t){var i=this._partialCache[n];return i?i(t):""},t.prototype._name=function(n,t,i){var r=t.lookup(n),u;return(typeof r=="function"&&(r=r.call(t.view)),u=r==null?"":String(r),i)?a(u):u},f=new t,n}());n.mustache=function(n,i,r){return t.render(n,i,r)};n.fn.mustache=function(t,i){return n(this).map(function(r,u){var f=n(u).html().trim(),e=n.mustache(f,t,i);return n(e).get()})}}(jQuery);this.JSON||(JSON=function(){function t(n){return n<10?"0"+n:n}function n(t,r){var e,u,f,s,h=/["\\\x00-\x1f\x7f-\x9f]/g,o;switch(typeof t){case"string":return h.test(t)?'"'+t.replace(h,function(n){var t=i[n];return t?t:(t=n.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})+'"':'"'+t+'"';case"number":return isFinite(t)?String(t):"null";case"boolean":case"null":return String(t);case"object":if(!t)return"null";if(typeof t.toJSON=="function")return n(t.toJSON());if(e=[],typeof t.length=="number"&&!t.propertyIsEnumerable("length")){for(s=t.length,u=0;u<s;u+=1)e.push(n(t[u],r)||"null");return"["+e.join(",")+"]"}if(r)for(s=r.length,u=0;u<s;u+=1)f=r[u],typeof f=="string"&&(o=n(t[f],r),o&&e.push(n(f)+":"+o));else for(f in t)typeof f=="string"&&(o=n(t[f],r),o&&e.push(n(f)+":"+o));return"{"+e.join(",")+"}"}}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+t(this.getUTCMonth()+1)+"-"+t(this.getUTCDate())+"T"+t(this.getUTCHours())+":"+t(this.getUTCMinutes())+":"+t(this.getUTCSeconds())+"Z"};var i={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return{stringify:n,parse:function(text,filter){function walk(n,t){var i,r;if(t&&typeof t=="object")for(i in t)Object.prototype.hasOwnProperty.apply(t,[i])&&(r=walk(i,t[i]),r!==undefined&&(t[i]=r));return filter(n,t)}var j;if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof filter=="function"?walk("",j):j;throw new SyntaxError("parseJSON");}}}());allMessageBoxes=[];MessageBox.prototype.exception=null;MessageBox.prototype.init=function(){var u,i,r;try{this.context=jQuery(this.settings.context);var e=this.context.find("."+this.settings.overlayClass).length>0,o=this.context.find("."+this.settings.contentClass).length>0,t="",n=this.settings.content;if(o||(t="<div class='"+this.settings.contentClass+"' role='dialog' style='"+this.settings.contentInlineCss+"'><\/div>",this.context.append(t),this.content=this.context.find("."+this.settings.contentClass)),e||(t="<div class='"+this.settings.overlayClass+"' style='"+this.settings.overlayInlineCss+"'><\/div>",this.context.append(t)),jQuery(n).is("div")||jQuery(n).is("span")||jQuery(n).is("article")||jQuery(n).is("li")||jQuery(n).is("aside"))this.settings.content=jQuery(n).html();else if(jQuery(n).length>0)this.settings.content=n;else try{u=this;u.load(n)}catch(s){this.exception=this.settings.failureMsg+" : setMsg : "+s}this.settings.enableTemplates&&(this.settings.content=this.settings.template.replace("<!--content-->",this.settings.content));this.content.html(this.settings.content);this.focusElement=this.content.find("a,input,select,checkbox,radio,textarea").eq(0);this.overlay=this.context.find("."+this.settings.overlayClass);this.setDimentions();this.overlay.bind("click",{obj:this},this.hide);i=$(window).width();r=$(window).height();jQuery(window).bind("resize",{obj:this},function(n){var t=$(window).width(),u=$(window).height();(i!=t||r!=u)&&n.data.obj.hide();i=t;r=u});this.context.bind("keyup",{obj:this},function(n){if(n.keyCode===27){var t=n.data.obj;t.hide()}});this.settings.callback();this.exception=null}catch(f){this.exception=this.settings.failureMsg+" : init : "+f;this.settings.onFail(this.settings.failureMsg+" : init : "+f)}};MessageBox.prototype.load=function(n){var t,r,i;try{t=this;r="get";t.content.addClass(t.settings.loaderClass);i=jQuery.ajax({url:n,dataType:t.settings.dataType,type:r,data:t.settings.postData,async:t.settings.async});i.done(function(n){t.content.html(t.settings.template.replace("<!--content-->",n));t.content.removeClass(t.settings.loaderClass);t.settings.callback();t.settings.onShow()});i.fail(function(){return t.settings.content=n,t.content.removeClass(t.settings.loaderClass),!1});this.exception=null}catch(u){this.exception=this.settings.failureMsg+" : setMsg : "+u}};MessageBox.prototype.setDimentions=function(n){var t,i,r,s,h;if(n=n===undefined||n===null||n===""?this:n,n.content.removeAttr("style"),t=0,i=0,n.settings.width==="auto"||n.settings.height==="auto"?(n.settings.width==="auto"&&n.content.css({width:"auto"}),n.settings.height==="auto"&&n.content.css({height:"auto"}),t=n.content.width(),i=n.content.height()):(n.settings.width===""?(n.content.css("width")<=0&&n.content.css({width:"auto"}),t=n.content.width()):t=parseInt(n.settings.width),n.settings.height===""?(n.content.css("height")<=0&&n.content.css({height:"auto"}),i=n.content.height()):i=parseInt(n.settings.height)),t===0||i===0)setTimeout(n.setDimentions,100,n);else{var f=parseInt(n.settings.minTop),e=parseInt(n.settings.minLeft),o=jQuery(document).scrollTop(),u=jQuery(window).height()/2-i/2;u=u<f?f:u;r=jQuery(document).width()/2-t/2;r=r<e?e:r;s=n.settings.top==="auto"?u+o:parseInt(n.settings.top)+o;h=n.settings.left==="auto"?r:parseInt(n.settings.left);n.content.css({width:t,height:i,top:s,left:h})}n.overlay.css({width:jQuery(document).width(),height:jQuery(document).height(),top:0,left:0})};MessageBox.prototype.show=function(n){var t,i;if(document.all&&!document.addEventListener)for(t=0;t<allMessageBoxes.length;t++)allMessageBoxes[t]!=this&&allMessageBoxes[t].hide();$("html").hasClass("ie")?(i=this,setTimeout(function(){i.actualShow(n)},500)):this.actualShow(n)};MessageBox.prototype.actualShow=function(n){var t=n?n.data.obj:this,i;$("."+this.settings.contentClass,this.context).attr("aria-labelledby",$("h2.likeH1",$(this.content)).attr("id"));$("."+this.settings.contentClass,this.context).attr("aria-describedby",$("p.intro",$(this.content)).attr("id"));t.setDimentions(t);t.overlay.css("display","block");$.support.cssFloat||t.content.find("#closeButton").css("display","none");t.settings.animate?t.content.fadeIn(t.settings.animateTime):t.content.css("display","block");i=Math.max(document.documentElement.clientHeight,window.innerHeight||0);i>0&&!("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/11\.0/))&&t.content.css("position","fixed").css("top",(i-t.content.height())/2);$.support.cssFloat||setTimeout(function(){t.content.find("#closeButton").show()},500);this.lastFocused=jQuery(document.activeElement);t.settings.onShow()};MessageBox.prototype.hide=function(n){var t=n?n.data.obj:this,i;t.settings.animate?($.support.cssFloat||t.content.find("#closeButton").hide(),t.content.fadeOut(t.settings.animateTime),i=t.overlay,setTimeout(function(){i.css("display","none")},t.settings.animateTime,t.overlay)):(t.content.css("display","none"),t.overlay.css("display","none"));t.settings.onHide()};MessageBox.prototype.onFail=function(){};MessageBox.prototype.destroy=function(){this.overlay.unbind();jQuery("."+this.settings.contentClass,this.context).remove();jQuery("."+this.settings.overlayClass,this.context).remove()};MessageBox.prototype.setContent=function(n){this.settings.content=n};MessageBox.prototype.getMsg=function(){return this.settings.content};MessageBox.prototype.setWidth=function(n){this.settings.width=n};MessageBox.prototype.getWidth=function(){return this.settings.width};MessageBox.prototype.setHeight=function(n){this.settings.height=n};MessageBox.prototype.getHeight=function(){return this.settings.height};MessageBox.prototype.setTop=function(n){this.settings.top=n};MessageBox.prototype.getTop=function(){return this.settings.top};MessageBox.prototype.setLeft=function(n){this.settings.left=n};MessageBox.prototype.getLeft=function(){return this.settings.left};MessageBox.prototype.setMinTop=function(n){this.settings.minTop=n};MessageBox.prototype.setMinLeft=function(n){this.settings.minLeft=n};MessageBox.prototype.setContext=function(n){this.settings.context=n};MessageBox.prototype.getContext=function(){return this.settings.context};MessageBox.prototype.setOverlayClass=function(n){this.settings.overlayClass=n};MessageBox.prototype.getOverlayClass=function(){return this.settings.overlayClass};MessageBox.prototype.setOverlayInlineCss=function(n){this.settings.overlayInlineCss=n};MessageBox.prototype.getOverlayInlineCss=function(){return this.settings.overlayInlineCss};MessageBox.prototype.setContentClass=function(n){this.settings.contentClass=n};MessageBox.prototype.getContentClass=function(){return this.settings.contentClass};MessageBox.prototype.setContentInlineCss=function(n){this.settings.contentInlineCss=n};MessageBox.prototype.getContentInlineCss=function(){return this.settings.contentInlineCss};MessageBox.prototype.setLoaderClass=function(n){this.settings.loaderClass=n};MessageBox.prototype.getLoaderClass=function(){return this.settings.loaderClass};MessageBox.prototype.setFailureClass=function(n){this.settings.failureClass=n};MessageBox.prototype.getFailureClass=function(){return this.settings.failureClass};MessageBox.prototype.setZIndex=function(n){this.settings.zIndex=n};MessageBox.prototype.getZIndex=function(){return this.settings.zIndex};MessageBox.prototype.setOnFail=function(n){this.settings.onFail=n};MessageBox.prototype.getOnFail=function(){return this.settings.onFail};MessageBox.prototype.setCallback=function(n){this.settings.callback=n};MessageBox.prototype.getCallback=function(){return this.settings.callback};MessageBox.prototype.setOnShow=function(n){this.settings.onShow=n};MessageBox.prototype.getOnShow=function(){return this.settings.onShow};MessageBox.prototype.setOnHide=function(n){this.settings.onHide=n};MessageBox.prototype.getOnHide=function(){return this.settings.onHide};MessageBox.prototype.setDataType=function(n){this.settings.dataType=n};MessageBox.prototype.getDataType=function(){return this.settings.dataType};MessageBox.prototype.setFailureMsg=function(n){this.settings.failureMsg=n};MessageBox.prototype.getFailureMsg=function(){return this.settings.failureMsg};MessageBox.prototype.setAnimate=function(n){this.settings.animate=n};MessageBox.prototype.getAnimate=function(){return this.settings.animate};MessageBox.prototype.setAnimateTime=function(n){this.settings.animateTime=n};MessageBox.prototype.getAnimateTime=function(){return this.settings.animateTime};MessageBox.prototype.setEnableTemplates=function(n){this.settings.enableTemplates=n};MessageBox.prototype.getEnableTemplates=function(){return this.settings.enableTemplates};MessageBox.prototype.setTemplate=function(n){this.settings.template=n};MessageBox.prototype.getTemplate=function(){return this.settings.template};MessageBox.prototype.setPostData=function(n){this.settings.postData=n};MessageBox.prototype.setAsync=function(n){this.settings.async=n};MessageBox.prototype.setTriggerElement=function(n){this.settings.triggerElement=n};MessageBox.prototype.setTabindex=function(n){this.settings.tabindex=n};window.imgCheckCounter=0;window.currentNode=null;String.prototype.generateSlug=function(){return this.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")};FormDesigner.prototype.init=function(){try{var n=this;n.imageEnabled=!0;this.settings.checkImageEnabled?$("html").hasClass(this.settings.imageEnabledClass)?(n.imageEnabled=!0,window.imgCheckCounter=0,this.prepare()):$("html").hasClass(this.settings.imageDisabledClass)?(n.imageEnabled=!1,window.imgCheckCounter=0,this.prepare()):window.imgCheckCounter<20?(this.delayedFunc!=null&&clearTimeout(this.delayedFunc),this.delayedFunc=setTimeout(function(){n.init()},600),window.imgCheckCounter++):this.prepare():this.prepare()}catch(t){this.exception=t}};FormDesigner.prototype.prepare=function(){try{var n=this;if(n.settings.node!=null&&n.settings.node!="")n.settings.node.is("input[type=checkbox]")&&n.settings.masterCheckbox!=null&&(n.settings.node.push(n.settings.masterCheckbox),n.settings.masterCheckbox.unbind("click",n.selectInputs).bind("click",{obj:n},n.selectInputs)),n.settings.node.each(function(){var t=$(this),e,i,h,l,c,o,s,a,v,y,r,f,u;if(t.is("input[type=button]")||t.is("input[type=submit]")||t.is("select")){if((n.settings.checkImageEnabled==!0&&n.imageEnabled==!0||n.settings.checkImageEnabled==!1)&&t.hasClass(n.settings.buttonHideClass)==!1){if(r=t.attr("class"),t.wrap("<div class='"+r+"'><\/div>"),t.removeClass(r),f=t.is("select")?t.find("option:selected").text():t.val(),t.hasClass(n.settings.buttonHideClass)==!1&&t.addClass(n.settings.buttonHideClass),t.is("select")&&(n.settings.customDropDown?(e=f.toLowerCase().replace(/-+/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""),e.substr(-1,1)=="-"&&(e=e.slice(0,-1)),e.substr(0,1)=="-"&&(e=e.slice(1)),u="<div class='"+n.settings.buttonContainerClass+"' aria-hidden='true'>"+n.settings.template.replace("<!--text-->",f)+"<\/div>",t.after(u),n.addCustomDropDown(t)):(u="<div class='"+n.settings.buttonContainerClass+"'>"+n.settings.template.replace("<!--text-->",f)+"<\/div>",t.after(u)),t.unbind("change keyup",n.selectedIndexChange).bind("change keyup",{obj:n},n.selectedIndexChange)),(t.css("z-index")=="auto"||t.css("z-index")==0)&&t.css({"z-index":"15000"}),$(window).width()>768?t.css({left:"-9999px",zIndex:"0"}):t.css({opacity:"0"}),i=t.parent(),i.css("display")=="none"||i.parents().css("display")=="none"){for(h=[],i.parents().css("display")=="none"&&i.parents().each(function(){$(this).css("display")=="none"&&(h.push($(this)),$(this).addClass(n.settings.tempShowClass))}),l=!1,i.css("display")=="none"&&(l=!0,t.addClass(n.settings.tempShowClass)),o=i.width(),s=i.height(),c=0;c<h.length;c++)h[c].removeClass(n.settings.tempShowClass);l&&t.removeClass(n.settings.tempShowClass)}else o=i.width(),s=i.height();t.width(o);t.height(s);$(window).width()>=640?t.css({height:"33px"}):t.css({height:"66px"});a=null;i.children("."+n.settings.buttonContainerClass).find("*").each(function(){$(this).html()==f&&(a=$(this))});v=o-n.settings.contentMargin;n.ellipsis(a,v)}}else if(t.is("input[type=text]")||t.is("input[type=password]"))(n.settings.checkImageEnabled==!0&&n.imageEnabled==!0||n.settings.checkImageEnabled==!1)&&t.hasClass(n.settings.buttonHideClass)==!1&&(r=t.attr("class"),t.wrap("<div class='"+r+"'><\/div>"),t.removeClass(r),u=n.settings.template.replace("<!--text-->","<div id='tempNodePlaceHolder'><\/div>"),t.hasClass(n.settings.buttonHideClass)==!1&&t.addClass(n.settings.buttonHideClass),t.after(u),y=$("#tempNodePlaceHolder").parent(),t.appendTo(y),$("#tempNodePlaceHolder").remove(),t.css({border:"0",background:"transparent"}));else if(t.is("input[type=checkbox]")||t.is("input[type=radio]")){if((n.settings.checkImageEnabled==!0&&n.imageEnabled==!0||n.settings.checkImageEnabled==!1)&&t.hasClass(n.settings.buttonHideClass)==!1){r=t.attr("class");t.wrap("<div class='"+r+"'><\/div>");t.removeClass(r);t.hasClass(n.settings.buttonHideClass)==!1&&t.addClass(n.settings.buttonHideClass);var i=t.parent(),o=i.width(),s=i.height();t.width(o);t.height(s);(t.css("z-index")=="auto"||t.css("z-index")==0)&&t.css({"z-index":"15000"});t.css({opacity:"0",filter:"alpha(opacity=0)",position:"absolute",margin:"0",padding:"0"});t.is(":checked")&&t.parent().hasClass(n.settings.activeClass)==!1&&t.parent().addClass(n.settings.activeClass)}t.is("input[type=checkbox]")&&t.is(n.settings.masterCheckbox)==!1?t.unbind("change",n.updateCheckbox).bind("change",{obj:n},n.updateCheckbox):t.is("input[type=radio]")&&(n.settings.checkImageEnabled==!0&&n.imageEnabled==!0||n.settings.checkImageEnabled==!1)&&t.unbind("click",n.updateRadio).bind("click",{settings:n.settings},n.updateRadio)}else(t.is("a")||t.is("button.share"))&&(n.settings.checkImageEnabled==!0&&n.imageEnabled==!0||n.settings.checkImageEnabled==!1)&&t.hasClass(n.settings.buttonHideClass)==!1&&(f=t.html(),u=n.settings.template.replace("<!--text-->",f),t.html(u),t.addClass(n.settings.buttonHideClass),t.is("a")&&t.attr("role","button"))});else if(this.settings.node==null)throw"Element is not provided";else throw"Required parameters not found.";this.exception=null}catch(t){this.exception=t}};FormDesigner.prototype.updateCheckbox=function(n){try{var r=n!==undefined?n.data.obj:this,t=r.settings,i=t.node,u=!0;i.each(function(){i=$(this);i.is(":checked")?(t.checkImageEnabled==!0&&r.imageEnabled==!0||t.checkImageEnabled==!1)&&i.parent().hasClass(t.activeClass)==!1&&i.parent().addClass(t.activeClass):((t.checkImageEnabled==!0&&r.imageEnabled==!0||t.checkImageEnabled==!1)&&i.parent().hasClass(t.activeClass)&&i.parent().removeClass(t.activeClass),t.masterCheckbox!=null&&i.is(t.masterCheckbox)==!1&&(u=!1))});t.masterCheckbox!=null&&(u==!0?(t.masterCheckbox.prop("checked",!0),(t.checkImageEnabled==!0&&r.imageEnabled==!0||t.checkImageEnabled==!1)&&t.masterCheckbox.parent().hasClass(t.activeClass)==!1&&t.masterCheckbox.parent().addClass(t.activeClass)):(t.masterCheckbox.prop("checked",!1),(t.checkImageEnabled==!0&&r.imageEnabled==!0||t.checkImageEnabled==!1)&&t.masterCheckbox.parent().hasClass(t.activeClass)&&t.masterCheckbox.parent().removeClass(t.activeClass)))}catch(f){this.exception=f}};FormDesigner.prototype.updateRadio=function(n){try{var t=n.data.settings,i=$(this).attr("name"),r=$("input[name="+i+"]");r.each(function(){var n=$(this);n.is(":checked")?n.parent().hasClass(t.activeClass)==!1&&n.parent().addClass(t.activeClass):n.parent().hasClass(t.activeClass)&&n.parent().removeClass(t.activeClass)})}catch(u){this.exception=u}};FormDesigner.prototype.selectInputs=function(n){try{var t=n!==undefined?n.data.obj:this,r=t.settings.masterCheckbox,i=t.settings.node;r.is(":checked")?i.prop("checked",!0):i.prop("checked",!1);t.updateCheckbox()}catch(u){this.exception=u}};FormDesigner.prototype.addCustomDropDown=function(n){var t,o,c,l,i,u,f,s,v;try{if(t=this,n==null||n===undefined)throw"addCustomDropDown(node) - required parameter is missing";var r="",e=0,h=n.find("option");if(h.each(function(){var i=$(this).val(),n=t.settings.dropDownItemTemplate.replace("<!--text-->",$(this).text()).replace("{href}","#"+$(this).text().generateSlug());n=$(n);e==0?n.addClass(t.settings.customOptionFirstClass):e==h.length-1&&n.addClass(t.settings.customOptionLastClass);n=$(this).is(":selected")?n.val(i).addClass(t.settings.activeClass):n.val(i);n=n.wrap("<div>").parent().html();r=r+n;e++}),o=r,r='<div class="'+t.settings.customScrollContentClass+'">'+r+'<\/div><div class="'+t.settings.customScrollContainerClass+'"><div class="'+t.settings.customScrollerClass+'"><\/div><\/div>',r=$(t.settings.dropDownTemplate.replace("<!--itemtemplate-->",r)).addClass(t.settings.commonSelector).css("display","block").unbind("click",t.customSelect).bind("click",{obj:t},t.customSelect),t.settings.jsPositioning&&(c=parseInt(n.parent().position().top)+n.parent().height(),l=n.parent().position().left),n.siblings().last().after(r),i=n.siblings().last(),u=i.find("."+t.settings.customScrollContentClass),u.height()>i.height())if(t.settings.customScroll){f=i.find("."+t.settings.customScrollerClass);s=i.find("."+t.settings.customScrollContainerClass);s.height(u.parent().height());var a=s.height()-parseInt(f.css("margin-top"))-parseInt(f.css("margin-bottom")),y=u.height(),p=a/y;f.height(a*p);f.unbind("mousedown").bind("mousedown",{obj:t},t.bindScrollEvents);u.unbind("mousedown").bind("mousedown",{obj:t},t.bindScrollEvents);u.unbind("touchstart",t.bindTouchEvents).bind("touchstart",{obj:t},t.bindTouchEvents);i.unbind("mouseenter").bind("mouseenter",function(){window.currentNode=$(this).find("div").eq(0);$(this).attr("unselectable","on").css("user-select","none").bind("selectstart",!1);window.addEventListener&&window.addEventListener("DOMMouseScroll",t.mouseWheel,!1);window.onmousewheel=document.onmousewheel=t.mouseWheel});i.bind("mouseleave",function(){window.currentNode=null;$(document).unbind("DOMMouseScroll",t.mouseWheel);$(window).unbind("DOMMouseScroll",t.mouseWheel);window.addEventListener&&window.removeEventListener("DOMMouseScroll",t.mouseWheel,!1);window.onmousewheel=document.onmousewheel=null})}else i.remove(),r=$(t.settings.dropDownTemplate.replace("<!--itemtemplate-->",o)).addClass(t.settings.commonSelector).css("display","block").unbind("click",t.customSelect).bind("click",{obj:t},t.customSelect),n.siblings().last().after(r),i=n.siblings().last(),i.css({"overflow-y":"scroll","overflow-x":"hidden"});else i.remove(),r=$(t.settings.dropDownTemplate.replace("<!--itemtemplate-->",o)).addClass(t.settings.commonSelector).css("display","block").unbind("click",t.customSelect).bind("click",{obj:t},t.customSelect),n.siblings().last().after(r),i=n.siblings().last();i.parent().width()>i.width()&&i.width(i.parent().width());t.settings.jsPositioning&&i.css({top:c,left:l});v=n.next();i.hide();v.unbind("click",t.toggleCustomDropDown).bind("click",{obj:t},t.toggleCustomDropDown);$(document).unbind("click",t.hideCustomDropDown).bind("click",{obj:t},t.hideCustomDropDown)}catch(w){this.exception=w}};FormDesigner.prototype.toggleCustomDropDown=function(n){try{var t=n.data.obj,r=t.settings.dropDownTemplate,u=$(this),f=$(r).attr("class"),i=u.parent().find("."+f).eq(0);i.css("display")=="none"?($("."+t.settings.commonSelector).hide(),i.show(),i.children("."+t.settings.activeClass).focus()):$("."+t.settings.commonSelector).hide()}catch(e){this.exception=e}};FormDesigner.prototype.bindScrollEvents=function(n){n.stopPropagation();n.preventDefault();var t=n.data.obj,i=$(this).parents("."+t.settings.commonSelector);t.container=i.find("."+t.settings.customScrollContentClass);t.scroller=i.find("."+t.settings.customScrollerClass);t.scrollerContainer=i.find("."+t.settings.customScrollContainerClass);t.containerHeight=t.container.parent().height();t.contentHeight=t.container.height();t.scrollerPart=parseInt(n.pageY)-parseInt(t.scroller.offset().top);t.scrollTop=parseInt(t.scrollerContainer.offset().top)+t.scrollerPart;t.scrollHeight=parseInt(t.scrollerContainer.offset().top)+t.scrollerContainer.height()-t.scroller.height()+t.scrollerPart;$(document).bind("mousemove",{obj:t},t.updateScrollPosition);$(document).bind("mouseup",{obj:t},function(n){var t=n.data.obj;n.stopPropagation();n.preventDefault();$(document).unbind("mousemove",t.updateScrollPosition)})};FormDesigner.prototype.bindTouchEvents=function(n){var t,i,r,u;n.preventDefault();t=n.data.obj;i=$(this).parents("."+t.settings.commonSelector);t.container=i.find("."+t.settings.customScrollContentClass);t.scroller=i.find("."+t.settings.customScrollerClass);t.scrollerContainer=i.find("."+t.settings.customScrollContainerClass);t.containerHeight=t.container.parent().height();t.contentHeight=t.container.height();t.scrollerPart=parseInt(n.pageY)-parseInt(t.scroller.offset().top);t.scrollTop=parseInt(t.scrollerContainer.offset().top)+t.scrollerPart;t.scrollHeight=parseInt(t.scrollerContainer.offset().top)+t.scrollerContainer.height()-t.scroller.height()+t.scrollerPart;r=0;u=0;window.addEventListener?window.addEventListener("touchmove",t.updateTouchPosition,!1):window.touchmove=document.touchmove=t.updateTouchPosition;$(document).bind("touchend",{obj:t},function(n){var t=n.data.obj;n.stopPropagation();n.preventDefault();$(document).unbind("mousemove",t.updateTouchPosition)})};FormDesigner.prototype.hideCustomDropDown=function(n){try{var t=n.data.obj,i=$(n.target);i.hasClass(t.settings.buttonHideClass)==!1&&i.parents().hasClass(t.settings.buttonContainerClass)==!1&&i.parents().hasClass(t.settings.customScrollContainerClass)==!1&&$("."+t.settings.commonSelector).hide()}catch(r){this.exception=r}};FormDesigner.prototype.customSelect=function(n){try{n.preventDefault();var t=n.data.obj,i=$(n.target),u=i.val(),s=i.index();if(u!==undefined&&u!=null){i.addClass(t.settings.activeClass);i.siblings().removeClass(t.settings.activeClass);var f=$(this).siblings("select."+t.settings.buttonHideClass),r=$(this).siblings("."+t.settings.buttonContainerClass),e=i.text();r.val(u);f.get(0).selectedIndex=s;r.html(t.settings.template.replace("<!--text-->",e));var h=r.parent(),c=h.width()-t.settings.contentMargin,o=null;r.find("*").each(function(){$(this).html()==e&&(o=$(this))});t.ellipsis(o,c);f.trigger("change");r.trigger(t.settings.customSelectEvent)}}catch(l){this.exception=l}};FormDesigner.prototype.mouseWheel=function(n){var r;try{n||(n=window.event);n.wheelDelta?delta=n.wheelDelta/120:n.detail&&(delta=-n.detail/3);n.wheelDelta?delta=n.wheelDelta/120:n.detail&&(delta=-n.detail/3);n.preventDefault&&n.preventDefault();n.returnValue=!1;n.cancelBubble=!0;var u=0-(window.currentNode.height()-window.currentNode.parent().height()),i=parseInt(window.currentNode.css("margin-top")),t=50;if(t=delta<0?i-t<u?u-i:0-t:i+t>0?0-i:t,r=i+t,0>=r&&u<=r&&t!=0){window.currentNode.css("margin-top",r);var f=window.currentNode.next().children(),e=Math.abs(r/u),o=f.parent().height()-f.height()-parseInt(f.css("margin-bottom"));f.css("top",o*e)}}catch(s){this.exception=s}};FormDesigner.prototype.selectedIndexChange=function(n){var i,e,u;try{var r=n.data.obj,o=r.settings.template,t=$(this),h=t.parent().attr("class"),f=t.find("option:selected").text();t.next().html(o.replace("<!--text-->",f));i=t.parent();t.width(i.width());t.height(i.height());e=i.width()-r.settings.contentMargin;u=null;t.next().find("*").each(function(){$(this).html()==f&&(u=$(this))});r.ellipsis(u,e)}catch(s){this.exception=s}};FormDesigner.prototype.ellipsis=function(n,t){var r,i,f,e,u;try{for(r=n.html(),i=n.clone(!0,!0).show(),$("body").append(i),i.html(""),f="",e=3,r=r.split(""),u=0;u<r.length;u++)if(i.append(r[u]),e=u,i.width()>=t)break;f=i.width()>=t?i.text().substr(0,e-3)+"...":i.text();i.remove();n.html(f)}catch(o){this.exception=o}};FormDesigner.prototype.updateScrollPosition=function(n){var t,i;try{t=n.data.obj;n.pageY>=t.scrollTop&&n.pageY<t.scrollHeight&&(i=Math.abs((t.scrollTop-n.pageY)/t.containerHeight),t.container.css("margin-top",0-t.contentHeight*i),t.scroller.css("top",n.pageY-t.scrollTop))}catch(r){this.exception=r}};FormDesigner.prototype.updateTouchPosition=function(){try{}catch(n){this.exception=n}};FormDesigner.prototype.setNode=function(n){this.settings.node=n};FormDesigner.prototype.getNode=function(){return this.settings.node};FormDesigner.prototype.setMasterCheckbox=function(n){this.settings.masterCheckbox=n};FormDesigner.prototype.getMasterCheckbox=function(){return this.settings.masterCheckbox};FormDesigner.prototype.setButtonContainerClass=function(n){this.settings.buttonContainerClass=n};FormDesigner.prototype.getButtonContainerClass=function(){return this.settings.buttonContainerClass};FormDesigner.prototype.setTemplate=function(n){this.settings.template=n};FormDesigner.prototype.getTemplate=function(){return this.settings.template};FormDesigner.prototype.setButtonHideClass=function(n){this.settings.buttonHideClass=n};FormDesigner.prototype.getButtonHideClass=function(){return this.settings.buttonHideClass};FormDesigner.prototype.setCheckImageEnabled=function(n){this.settings.checkImageEnabled=n};FormDesigner.prototype.getCheckImageEnabled=function(){return this.settings.checkImageEnabled};FormDesigner.prototype.setActiveClass=function(n){this.settings.activeClass=n};FormDesigner.prototype.getActiveClass=function(){return this.settings.activeClass};FormDesigner.prototype.setCustomDropDown=function(n){this.settings.customDropDown=n};FormDesigner.prototype.setCustomDropDownClass=function(n){this.settings.customDropDownClass=n};FormDesigner.prototype.setDropDownTemplate=function(n){this.settings.dropDownTemplate=n};FormDesigner.prototype.setDropDownItemTemplate=function(n){this.settings.dropDownItemTemplate=n};FormDesigner.prototype.setCommonSelector=function(n){this.settings.commonSelector=n};FormDesigner.prototype.setCustomSelectEvent=function(n){this.settings.customSelectEvent=n};FormDesigner.prototype.setCustomOptionFirstClass=function(n){this.settings.customOptionFirstClass=n};FormDesigner.prototype.setCustomOptionLastClass=function(n){this.settings.customOptionLastClass=n};FormDesigner.prototype.setJSPositioning=function(n){this.settings.jsPositioning=n};FormDesigner.prototype.setCustomScroll=function(n){this.settings.customScroll=n};FormDesigner.prototype.setCustomScrollContentClass=function(n){this.settings.customScrollContentClass=n};FormDesigner.prototype.setCustomScrollContainerClass=function(n){this.settings.customScrollContainerClass=n};FormDesigner.prototype.setCustomScrollerClass=function(n){this.settings.customScrollerClass=n};window.showInstructions=!0;Accessibility.prototype.init=function(){try{var n=this;this.detectImageEnabled();n.update();this.settings.handdleDynamicContent&&$(document).ajaxStop(function(){n.update()})}catch(t){this.exception=t}};Accessibility.prototype.update=function(){var n,t;try{for(n=this,t=0;t<n.settings.rules.length;t++)n.processRule(n.settings.rules[t]);for(n.processToolTips(),$(n.settings.context).unbind("keydown",n.initKeyDown).bind("keydown",{obj:n},n.initKeyDown),n.settings.hideOnMouseMove&&$(n.settings.context).unbind("mousemove",n.initMouseMove).bind("mousemove",{obj:n},n.initMouseMove),$(n.settings.elements).unbind("keyup",n.initKeyUp).bind("keyup",{obj:n},n.initKeyUp),$(n.settings.elements).unbind(n.events.tab,n.initTabPress).bind(n.events.tab,{obj:n},n.initTabPress),t=0;t<n.settings.groups.length;t++)n.settings.groups[t].unbind(n.events.tab).bind(n.events.tab,{obj:n,group:n.settings.groups[t]},n.initGroupTabPress)}catch(i){this.exception=i}};Accessibility.prototype.detectImageEnabled=function(){var n=this,u=!1,i=function(){$("html").hasClass(n.settings.imageDisabledClass)&&$("html").removeClass(n.settings.imageDisabledClass);$("html").hasClass(n.settings.imageEnabledClass)==!1&&$("html").addClass(n.settings.imageEnabledClass);u=!0},r=function(){$("html").hasClass(n.settings.imageEnabledClass)&&$("html").removeClass(n.settings.imageEnabledClass);$("html").hasClass(n.settings.imageDisabledClass)==!1&&$("html").addClass(n.settings.imageDisabledClass)},t=new Image,f=(new Date).getTime();navigator.appName.indexOf("Microsoft Internet Explorer")!=-1?(t.onload=i,t.onabort=i,t.onerror=i,t.src=n.settings.pingImage+"?t="+f,setTimeout(function(){u==!1&&r()},0)):navigator.appName.indexOf("Opera")!=-1?(t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==?time="+(new Date).getTime(),t.complete?i():r()):(t.src=n.settings.pingImage+"?t="+f,navigator.userAgent.indexOf("BlackBerry")!=-1?t.complete?i():r():t.complete?r():i())};Accessibility.prototype.initKeyDown=function(n){var u=n.keyCode,o=n.shiftKey,t=n.data.obj,c=$(document.activeElement),i,s,f,e,h,r;if(u==t.settings.navKey){if(t.navigating=!0,$(t.settings.elements).removeClass(t.settings.focusedClass),t.settings.instructions!=null&&window.showInstructions==!0){if(t.settings.instructions.css("display")=="block"){if(n.preventDefault(),i=t.settings.instructions.find("a"),o==!0)if(t.instructionsReachedFromOutside)t.selectedInstructionNodeNo=i.length-1,t.instructionsReachedFromOutside=!1;else if(t.selectedInstructionNodeNo>0&&t.selectedInstructionNodeNo<i.length&&t.insideGroup==!0)t.selectedInstructionNodeNo-=1;else if(t.selectedInstructionNodeNo==i.length-1&&t.insideGroup==!1)t.selectedInstructionNodeNo=i.length-1,t.insideGroup=!0;else if(t.insideGroup==!1)t.selectedInstructionNodeNo=i.length-1;else return t.toggleInfoBox(),t.setFocus($("footer").find($(t.settings.elements)).last()),t.updateToolTip(500),!0;else if(t.instructionsReachedFromOutside)t.selectedInstructionNodeNo=0,t.instructionsReachedFromOutside=!1;else if(t.selectedInstructionNodeNo>=0&&t.selectedInstructionNodeNo<i.length-1&&t.insideGroup==!0)t.selectedInstructionNodeNo+=1;else if(t.selectedInstructionNodeNo==0&&t.insideGroup==!1)t.selectedInstructionNodeNo+=1,t.insideGroup=!0;else if(t.selectedInstructionNodeNo>0&&t.selectedInstructionNodeNo<i.length-1&&t.insideGroup==!1)t.selectedInstructionNodeNo+=1;else if(t.insideGroup==!1)t.selectedInstructionNodeNo=0;else return t.toggleInfoBox(),t.setFocus($("header").find($(t.settings.elements)).eq(0)),t.updateToolTip(500),!0;return i.removeClass(t.settings.focusedClass),i.eq(t.selectedInstructionNodeNo).focus(),i.eq(t.selectedInstructionNodeNo).addClass(t.settings.focusedClass),!1}t.toggleInfoBox()}if(t.settings.instructions==null||window.showInstructions==!1){for(s=!1,f=0;f<t.settings.groups.length;f++)e=1,h=t.settings.groups[f].length,t.settings.groups[f].each(function(){if((o==!1&&e!=h||o==!0&&e!=1)&&$(this).is(c))return s=!0,!1;e++});if(s==!0)return n.preventDefault(),!1}}else u==t.settings.escKey?(n.preventDefault(),t.initReset(n),t.selectedNode!=null&&(r=jQuery.Event(t.events.esc),r.keyCode=u,r.shiftKey=n.shiftKey,t.selectedNode.trigger(r))):u==t.settings.enterKey?t.selectedNode!=null&&(r=jQuery.Event(t.events.enter),r.keyCode=u,r.shiftKey=n.shiftKey,t.selectedNode.trigger(r)):u==t.settings.ctrlKey&&t.selectedNode!=null&&t.settings.pointOnFocus&&($("html,body").animate({scrollTop:t.lastPos},300),t.pointFocused())};Accessibility.prototype.initMouseMove=function(n){var t=n.data.obj;t.initReset(n)};Accessibility.prototype.initReset=function(n){var t=n!==undefined?n.data.obj:this,i,r;t.navigating==!0&&(this.settings.instructions!=null&&this.settings.instructions.css("display")=="block"&&(window.showInstructions=!1,this.settings.instructions.slideUp(500)),$(t.settings.elements).removeClass(t.settings.focusedClass),$("#"+t.settings.toolTipWrapperId).remove(),i=$("#"+this.settings.pointerWrapperId),i.length>0&&i.remove(),r=jQuery.Event(t.events.blur),$(t.settings.elements).trigger(r),t.navigating=!1)};Accessibility.prototype.initKeyUp=function(n){var r=n.keyCode,t=n.data.obj,i;t.selectedNode=$(this);(t.settings.instructions==null||t.settings.instructions.css("display")=="none")&&r==t.settings.navKey&&(n.preventDefault(),i=jQuery.Event(t.events.tab),i.keyCode=r,i.shiftKey=n.shiftKey,t.selectedNode.trigger(i))};Accessibility.prototype.initTabPress=function(n){var t=n.data.obj;t.insideGroup=!1;t.setFocus($(this),n)};Accessibility.prototype.initGroupTabPress=function(n){var u,f,r;n.preventDefault();var e=n.keyCode,o=n.shiftKey,t=n.data.obj,i=n.data.group;t.lastGroup=i;o==!0?t.selectedNodeNo>0&&t.selectedNodeNo<i.length&&t.insideGroup==!0?t.selectedNodeNo-=1:t.selectedNodeNo==i.length-1&&t.insideGroup==!1?(t.selectedNodeNo=i.length-1,t.prevNodeNo=i.length-1,t.insideGroup=!0):(t.selectedNodeNo=i.length-1,t.prevNodeNo=i.length-1,t.insideGroup=!0):t.selectedNodeNo>=0&&t.selectedNodeNo<i.length-1&&t.insideGroup==!0?t.selectedNodeNo+=1:t.selectedNodeNo==0&&t.insideGroup==!1?(t.selectedNodeNo=0,t.prevNodeNo=0,t.insideGroup=!0):t.selectedNodeNo>0&&t.selectedNodeNo<i.length-1&&t.insideGroup==!1?t.selectedNodeNo+=1:(t.selectedNodeNo=0,t.prevNodeNo=0,t.insideGroup=!0);u=i.eq(t.prevNodeNo);f=i.eq(t.selectedNodeNo);f.is(u)==!1&&(r=jQuery.Event(t.events.blur),r.keyCode=n!==undefined?e:t.settings.navKey,r.shiftKey=n!==undefined?n.shiftKey:!1,u.trigger(r));t.prevNodeNo=t.selectedNodeNo;t.setFocus(f,n)};Accessibility.prototype.setFocus=function(n,t){var u,i,r;t!==undefined?(u=t.keyCode,i=t.data.obj):i=this;i.selectedNode=n;i.selectedNode.focus();$(i.settings.elements).removeClass(i.settings.focusedClass);i.selectedNode.addClass(i.settings.focusedClass);i.prevNode!=null&&(r=jQuery.Event(i.events.blur),r.keyCode=t!==undefined?u:i.settings.navKey,r.shiftKey=t!==undefined?t.shiftKey:!1,i.prevNode.trigger(r));r=jQuery.Event(i.events.focus);r.keyCode=t!==undefined?u:i.settings.navKey;r.shiftKey=t!==undefined?t.shiftKey:!1;i.selectedNode.trigger(r);i.prevNode=i.selectedNode;i.updateToolTip()};Accessibility.prototype.hideToolTip=function(){var n=$("#"+this.settings.toolTipWrapperId);n.remove()};Accessibility.prototype.updateToolTip=function(n){var t=this,i="left",n=n!==undefined?parseInt(n):0;setTimeout(function(){var r,f,u,a;$("#"+t.settings.toolTipWrapperId).length>0&&$("#"+t.settings.toolTipWrapperId).remove();t.hasToolTip=!1;r=t.selectedNode.attr(t.settings.toolTipAttr);r!==undefined&&r!=""?(f=t.settings.toolTipTemplate.replace("<!--text-->",r),f="<div id='"+t.settings.toolTipWrapperId+"' class='"+t.settings.toolTipWrapperId+"'>"+f+"<\/div>",t.hasToolTip=!0):f="<div id='"+t.settings.toolTipWrapperId+"' class='"+t.settings.toolTipWrapperId+"'>"+t.settings.labelTemplate+"<\/div>";$("body").append(f);var e=$("#"+t.settings.toolTipWrapperId),n=t.selectedNode.offset().top,s=t.selectedNode.offset().left,l=e.children().eq(0).outerWidth(),h=e.children().eq(0).outerHeight(),b=t.selectedNode.outerWidth(),v=t.selectedNode.outerHeight(),o=e.find("."+t.settings.pointerClass),c=o.outerHeight()/2,y=o.outerWidth()/2,p=s-l-y,w=n-h-c;p<0&&(i="top",w<0&&(i="bottom"));i=="top"?(n=n-h-c,o.css({top:h+"px"}),o.addClass("bottom")):i=="bottom"?(n=n+v+parseFloat(t.selectedNode.css("padding-top"))+parseFloat(t.selectedNode.css("padding-bottom"))+c,o.addClass("top")):(paddingTop=r!==undefined&&r!=""?0:parseFloat(t.selectedNode.css("padding-top")),paddingLeft=r!==undefined&&r!=""?0:parseFloat(t.selectedNode.css("padding-left")),n=n+paddingTop,s=s-l);e.css({position:"absolute"});e.offset({top:n,left:s});u=n-$(window).height()/2;u=n>$(window).height()/2?u:$("html,body").scrollTop();t.settings.enableScrolling===!0&&(a=Math.abs(u-t.lastPos),a>10?$("html,body").animate({scrollTop:u},300):$("html,body").scrollTop(u));t.lastPos=u},n)};Accessibility.prototype.pointFocused=function(){var n,t;(this.settings.instructions==null||window.showInstructions==!1)&&(n=$("#"+this.settings.pointerWrapperId),n.length>0&&n.remove(),t=this.hasToolTip?" "+this.settings.hasToolTipClass:"",n="<div id='"+this.settings.pointerWrapperId+"' class='"+this.settings.pointerWrapperId+t+"'>"+this.settings.pointerTemplate+"<\/div>",$("body").append(n),n=$("#"+this.settings.pointerWrapperId),n.css({position:"absolute"}),n.offset({top:this.pointerTop,left:this.pointerLeft}),setTimeout(function(){n.remove()},1e3))};Accessibility.prototype.customTrigger=function(e){var right_event=e.data.event,right_element=e.data.element;right_element=typeof right_element=="string"?eval("$(this)."+right_element):right_element;right_element.trigger(right_event)};Accessibility.prototype.customFunction=function(e){var obj=e.data.obj,func=e.data.func,node=$(this),group=e.data.group;eval("obj."+func)};Accessibility.prototype.processRule=function(rule){var ruleSplits,mode,left,right,left_element,group,right_element;try{if(rule.indexOf(" trigger ")>=0)ruleSplits=rule.split(" trigger "),mode="trigger";else if(rule.indexOf(" run ")>=0)ruleSplits=rule.split(" run "),mode="run";else if(rule.indexOf("group ")>=0)ruleSplits=rule.split("group "),mode="group";else throw"Invalid rule.";if(mode=="trigger"||mode=="run"){left=ruleSplits[0];right=ruleSplits[1];left=left.replace(/\bfocus\b/gi,this.events.focus);left=left.replace(/\benter\b/gi,this.events.enter);left=left.replace(/\bblur\b/gi,this.events.blur);left=left.replace(/\besc\b/gi,this.events.esc);var left_splits=left.split(" on "),left_event=left_splits[0],left_pattern=/^\$\(('|")[\w->\.# ]+('|")\)(\.[\w-]+\(((('|")[\w->\.# ]+('|"))|([\d]+))?\))*$/i;left_element=left_splits[1]=="document"?$(eval(left_splits[1])):left_pattern.exec(left_splits[1])!=null?eval(left_splits[1]):$(left_splits[1])}else mode=="group"&&(group=typeof ruleSplits[1]=="undefined"?ruleSplits[0]:ruleSplits[1],group=$(group),this.addGroup(group));if(mode=="trigger"){var right_splits=right.split(" on "),right_event=right_splits[0],right_pattern=/(parent|children|siblings|next|prev)+/i;right_element=right_pattern.exec(right_splits[1])!=null?right_splits[1]:eval("$('"+right_splits[1]+"')");left_element.unbind(left_event,this.customTrigger).bind(left_event,{event:right_event,element:right_element},this.customTrigger)}else mode=="run"&&left_element.unbind(left_event,this.customFunction).bind(left_event,{func:right,obj:this,group:left_element},this.customFunction)}catch(ex){this.exception=ex}};Accessibility.prototype.processToolTips=function(){try{for(var n=0;n<this.settings.tooltips.length;n++)this.settings.tooltips[n][0].attr(this.settings.toolTipAttr,this.settings.tooltips[n][1])}catch(t){this.exception=t}};Accessibility.prototype.toggleInfoBox=function(){this.settings.instructions!=null&&this.settings.instructions.css("display")=="block"?this.hideInfoBox():this.settings.instructions!=null&&this.settings.instructions.css("display")=="none"&&this.showInfoBox()};Accessibility.prototype.showInfoBox=function(){window.showInstructions=!0;var t=this.settings.instructions.find("a"),n=this;t.removeClass(n.settings.focusedClass);t.eq(n.selectedInstructionNodeNo).addClass(n.settings.focusedClass);n.settings.instructions.slideDown(500);$("html, body").animate({scrollTop:0},300,"swing",function(){t.eq(n.selectedInstructionNodeNo).focus()})};Accessibility.prototype.hideInfoBox=function(){window.showInstructions=!1;this.settings.instructions.slideUp(500);this.selectedNodeNo=-1};Accessibility.prototype.addRule=function(n){this.settings.rules.push(n)};Accessibility.prototype.addGroup=function(n){this.settings.groups.push(n)};Accessibility.prototype.addToolTip=function(n,t){var i=[];i.push(n);i.push(t);this.settings.tooltips.push(i)};Accessibility.prototype.addDirection=function(n,t){var i=[];i.push(n);i.push(t);this.settings.directions.push(i)};Accessibility.prototype.setContext=function(n){this.settings.context=n};Accessibility.prototype.getContext=function(){return this.settings.context};Accessibility.prototype.setElements=function(n){this.settings.elements=n};Accessibility.prototype.getElements=function(){return this.settings.elements};Accessibility.prototype.setInstructions=function(n){this.settings.instructions=n};Accessibility.prototype.getInstructions=function(){return this.settings.instructions};Accessibility.prototype.setFocusedClass=function(n){this.settings.focusedClass=n};Accessibility.prototype.getFocusedClass=function(){return this.settings.focusedClass};Accessibility.prototype.setToolTipWrapperId=function(n){this.settings.toolTipWrapperId=n};Accessibility.prototype.getToolTipWrapperId=function(){return this.settings.toolTipWrapperId};Accessibility.prototype.setToolTipTemplate=function(n){this.settings.toolTipTemplate=n};Accessibility.prototype.getToolTipTemplate=function(){return this.settings.toolTipTemplate};Accessibility.prototype.setPointerWrapperId=function(n){this.settings.pointerWrapperId=n};Accessibility.prototype.getPointerWrapperId=function(){return this.settings.pointerWrapperId};Accessibility.prototype.setPointerTemplate=function(n){this.settings.pointerTemplate=n};Accessibility.prototype.getPointerTemplate=function(){return this.settings.pointerTemplate};Accessibility.prototype.setLabelTemplate=function(n){this.settings.labelTemplate=n};Accessibility.prototype.getLabelTemplate=function(){return this.settings.labelTemplate};Accessibility.prototype.setToolTipAttr=function(n){this.settings.toolTipAttr=n};Accessibility.prototype.getToolTipAttr=function(){return this.settings.toolTipAttr};Accessibility.prototype.setHideOnMouseMove=function(n){this.settings.hideOnMouseMove=n};Accessibility.prototype.getHideOnMouseMove=function(){return this.settings.hideOnMouseMove};Accessibility.prototype.setPointOnFocus=function(n){this.settings.pointOnFocus=n};Accessibility.prototype.getPointOnFocus=function(){return this.settings.pointOnFocus};Accessibility.prototype.setpointOnGaps=function(n){this.settings.pointOnGaps=n};Accessibility.prototype.getpointOnGaps=function(){return this.settings.pointOnGaps};Accessibility.prototype.setHanddleDynamicContent=function(n){this.settings.handdleDynamicContent=n};Accessibility.prototype.getHanddleDynamicContent=function(){return this.settings.handdleDynamicContent};Accessibility.prototype.setNavKey=function(n){this.settings.navKey=n};Accessibility.prototype.getNavKey=function(){return this.settings.navKey};Accessibility.prototype.setEnterKey=function(n){this.settings.enterKey=n};Accessibility.prototype.getEnterKey=function(){return this.settings.enterKey};Accessibility.prototype.setEscKey=function(n){this.settings.escKey=n};Accessibility.prototype.getEscKey=function(){return this.settings.escKey};Accessibility.prototype.setEnableScrolling=function(n){this.settings.enableScrolling=n};Accessibility.prototype.getEnableScrolling=function(){return this.settings.enableScrolling};Carousel.prototype.init=function(){var n,f,u;try{if(this.settings.container!=null&&(this.settings.src==""||this.settings.src==null)){this.restore=$(this.settings.container).html();this.deepRestore=$(this.settings.container).clone(!0,!0);this.restoreNav=$(this.settings.navigation).html();this.deepRestoreNav=$(this.settings.navigation).clone(!0,!0);var t=$(this.settings.container),r=this,i=Math.floor(Math.random()*1e5+1);if(this.banners=$("."+this.settings.bannerClass,t),this.bannerWidth=this.banners.eq(0).width(),this.bannerCount=this.banners.length,this.settings.type=="slider"){if(n=0,this.banners.each(function(){var t,u;r.settings.bannerGroup>1?(t=" style = 'position : absolute'",n%r.settings.bannerGroup==0&&(n!=0&&(t=" style = 'position : absolute; visibility : hidden'"),u=r.banners.slice(n,n+r.settings.bannerGroup),u.wrapAll("<div class='"+i+"'"+t+"><\/div>"))):n!=0&&$(this).css("visibility","hidden");n++}),this.settings.bannerGroup>1&&(this.settings.bannerClass=i,this.banners=$("."+this.settings.bannerClass,t),this.bannerWidth=$(this.banners[0]).width(),this.bannerCount=this.banners.length,$("."+i).css({width:this.bannerWidth})),this.settings.navigation!=null&&this.settings.navigation!=""&&this.bannerCount>1){for(f="",u=0;u<this.bannerCount;u++)f+=this.settings.navItemHTML.replace("{{groupNo}}",u+1+" of "+this.bannerCount);this.settings.navigation.html(f);this.settings.navigation.children().eq(0).addClass(this.settings.navActiveClass);this.settings.navigation.children().unbind("click",this.selectBanner).bind("click",{obj:this},this.selectBanner);this.settings.navigation.children().eq(0).addClass(this.settings.navActiveClass).find("a").append('<span class="screen-reader-only"> currently selected<\/span>')}}else if(this.settings.type=="scroller"){this.banners.wrapAll("<div class='"+i+" "+this.settings.bannerWrapperClass+"'><\/div>");var h=t.width(),e=(this.bannerWidth+this.settings.correction)*this.bannerCount,o=t.height();this.wrapper=$("."+i,t);this.moveBy=this.bannerWidth*this.settings.moveBy+this.settings.correction;this.wrapper.css({position:"absolute",width:e,height:o,"margin-left":0})}}else{if(this.settings.container==null)throw"Container object is not provided";else if(typeof this.settings.src!="object")throw"Source object is invalid : required type - object : provided type - "+typeof this.settings.src;else if(this.settings.src[0].url===undefined)throw'Source object is invalid : required format : [ {"url" : "sample/url/sample.jpg", "content" : "<div class=\'content\'>content is optional<\/div>"}, {"url" : "sample/url/sample.jpg"}]';if(this.settings.src.length>0)throw"source list implementation not supported";else throw"Source object is empty";}}catch(s){this.exception=s;this.carousel=null}finally{return this.carousel}};Carousel.prototype.show=function(n){var f;try{if(this.settings.type=="slider"){var o=0,i=this.settings.animateTime,e=this.selected,t=null,r=null,u=this.bannerWidth,s=this.direction;this.banners.each(function(){o==n&&(t=$(this));o==e&&(r=$(this));$(this).stop(!0,!0,!0);o++});this.settings.rotateBanners==!1?n>e?(t.css({visibility:"visible","margin-left":u}),r.css({visibility:"visible","margin-left":"0px"}),t.animate({"margin-left":0},i),r.animate({"margin-left":0-u},i,function(){$(this).css({visibility:"hidden","margin-left":"0px"})})):n<e&&(t.css({visibility:"visible","margin-left":0-u}),r.css({visibility:"visible","margin-left":"0px"}),t.animate({"margin-left":0},i),r.animate({"margin-left":u},i,function(){$(this).css({visibility:"hidden","margin-left":"0px"})})):s=="right"?(t.css({visibility:"visible","margin-left":u}),r.css({visibility:"visible","margin-left":"0px"}),t.animate({"margin-left":0},i),r.animate({"margin-left":0-u},i,function(){$(this).css({visibility:"hidden","margin-left":"0px"})})):s=="left"&&(t.css({visibility:"visible","margin-left":0-u}),r.css({visibility:"visible","margin-left":"0px"}),t.animate({"margin-left":0},i),r.animate({"margin-left":u},i,function(){$(this).css({visibility:"hidden","margin-left":"0px"})}));this.settings.navigation!=null&&this.settings.navigation!=""&&this.bannerCount>1&&(this.settings.navigation.children().eq(e).removeClass(this.settings.navActiveClass).find("span.screen-reader-only").remove(),this.settings.navigation.children().eq(n).addClass(this.settings.navActiveClass).find("a").append('<span class="screen-reader-only"> currently selected<\/span>'));this.settings.autoHeight==!0&&(f=t.height(),this.settings.minHeight!=null&&f<this.settings.minHeight&&(f=this.settings.minHeight),this.settings.maxHeight!=null&&f>this.settings.maxHeight&&(f=this.settings.maxHeight),this.settings.container.stop(!0,!0,!0).animate({height:f},i/2))}else this.settings.type=="scroller"&&(this.direction=="right"?this.marginLeft=parseInt(this.wrapper.css("margin-left"))-this.moveBy:this.direction=="left"&&(this.marginLeft=parseInt(this.wrapper.css("margin-left"))+this.moveBy),this.wrapper.stop(!0,!0,!0).animate({"margin-left":this.marginLeft}));this.selected=n}catch(h){this.exception=h}};Carousel.prototype.next=function(){var n,t,i;try{n=1;t=!0;this.settings.type=="scroller"&&(t=this.marginLeft>this.settings.container.width()-this.wrapper.width()+this.settings.correction,n=this.settings.moveBy);t&&(i=0,this.selected<this.bannerCount-1&&(i=this.selected+n),this.direction="right",this.show(i))}catch(r){this.exception=r}};Carousel.prototype.prev=function(){var n,t,i;try{n=1;t=!0;this.settings.type=="scroller"&&(t=this.marginLeft<0,n=this.settings.moveBy);t&&(i=this.bannerCount-1,0<this.selected&&(i=this.selected-n),this.direction="left",this.show(i))}catch(r){this.exception=r}};Carousel.prototype.selectBanner=function(n){try{n.preventDefault();var t=n.data.obj,i=$(this).index();t.selected<i?(t.direction="right",t.show(i)):t.selected>i&&(t.direction="left",t.show(i))}catch(r){this.exception=r}};Carousel.prototype.reset=function(n){try{n?($(this.settings.container).after(this.deepRestore),$(this.settings.container).remove(),$(this.settings.navigation).after(this.deepRestoreNav),$(this.settings.navigation).remove()):($(this.settings.container).html(this.restore),$(this.settings.navigation).html(this.restoreNav))}catch(t){this.exception=t}};Carousel.prototype.setContainer=function(n){this.settings.container=n};Carousel.prototype.getContainer=function(){return this.settings.container};Carousel.prototype.setSrc=function(n){this.settings.src=n};Carousel.prototype.getSrc=function(){return this.settings.src};Carousel.prototype.setNavigation=function(n){this.settings.navigation=n};Carousel.prototype.getNavigation=function(){return this.settings.navigation};Carousel.prototype.setNavItemHTML=function(n){this.settings.navItemHTML=n};Carousel.prototype.getNavItemHTML=function(){return this.settings.navItemHTML};Carousel.prototype.setNavigationActiveClass=function(n){this.settings.navActiveClass=n};Carousel.prototype.getNavigationActiveClass=function(){return this.settings.navActiveClass};Carousel.prototype.setBannerClass=function(n){this.settings.bannerClass=n};Carousel.prototype.getBannerClass=function(){return this.settings.bannerClass};Carousel.prototype.setBannerGroup=function(n){this.settings.bannerGroup=n};Carousel.prototype.getBannerGroup=function(){return this.settings.bannerGroup};Carousel.prototype.setRotateBanners=function(n){this.settings.rotateBanners=n};Carousel.prototype.getRotateBanners=function(){return this.settings.rotateBanners};Carousel.prototype.setAnimateTime=function(n){this.settings.animateTime=n};Carousel.prototype.getAnimateTime=function(){return this.settings.animateTime};Carousel.prototype.setAutoHeight=function(n){this.settings.autoHeight=n};Carousel.prototype.getAutoHeight=function(){return this.settings.autoHeight};Carousel.prototype.setMinHeight=function(n){this.settings.minHeight=n};Carousel.prototype.getMinHeight=function(){return this.settings.minHeight};Carousel.prototype.setMaxHeight=function(n){this.settings.maxHeight=n};Carousel.prototype.getMaxHeight=function(){return this.settings.maxHeight};Carousel.prototype.setCorrection=function(n){this.settings.type=="scroller"&&(this.settings.correction=n)};Carousel.prototype.getCorrection=function(){return this.settings.type=="scroller"?this.settings.correction:null};Accordian.prototype.init=function(n){var e=this.toggle,r=1,s="",t=this.settings,f=t.node;if(f.is("table")){var i="",o=0,u=t.clickableColumns=="all"||t.clickableColumns=="none"||t.clickableColumns=="first"||t.clickableColumns=="last"?t.clickableColumns:t.clickableColumns.toString();f.find("tr."+t.titleClass).each(function(){var n=0,r=$(this),s=r.next(),h=r.find("td").length,f;s.hasClass(t.contentClass)&&r.find("td").each(function(){if(u=="all"||u=="first"&&n==0||u=="last"&&n+1==h||t.iconLocation=="left"&&n==0||t.iconLocation=="right"&&n+1==h||u.search($(this).index()+1)>-1){var f=t.linkClass,r=$(this).html();i="";t.showIcon==!0&&(t.iconLocation=="left"&&n==0||t.iconLocation=="right"&&n+1==h)&&$(this).addClass(t.iconClass).addClass(t.iconExpand);i+="<a href='javascript:void(0);' class='"+t.linkClass+"' >";i+=r;i+="<\/a>";$(this).html(i)}n++});f=$(this).find("td."+t.iconClass);t.selectedItem==o+1&&(r.hasClass(t.lastClass)&&(r.removeClass(t.lastClass),s.addClass(t.lastClass)),s.show(),f.removeClass(t.iconExpand).addClass(t.iconCollapse));r.find("a."+t.linkClass).bind("click",{dataObj:r,settings:t},e);o++;f.parents(".no-arrow").length>0&&f.remove()})}else f.find("."+t.itemClass).each(function(){var i=$(this),n=i.find("."+t.titleClass),l=n==null||n==""?"":n.html(),f=i.find("."+t.subTitleClass).html(),f=f==null||f==""?"":f,h,o,c,u,a;i.find("."+t.subTitleClass).remove();h=s+"_link_"+r;o="3";t.headingLevels.indexOf(t.headingLevel)!=-1&&(o=t.headingLevel);c="<h"+o+' class="title-elevated expand-title"><a id="'+h+'" class="'+t.linkClass+'" href="javascript:void(0);" aria-expanded="false">\t\t\t\t<div class="'+t.leftClass+'"><\/div>\t\t\t\t<div class="'+t.middleClass+'">\t\t\t\t  <div class="'+t.iconClass+" "+t.iconExpand+'"><\/div>\t\t\t\t  <div class="'+t.titleTextClass+'">'+l+'<\/div>\t\t\t\t  <div class="'+t.subTitleTextClass+'">'+f+'<\/div>\t\t\t\t<\/div>\t\t\t\t<div class="'+t.rightClass+'"><\/div>\t\t\t<\/a><\/h'+o+">";n.html(c);$("a."+t.linkClass).parents(".no-arrow").length>0&&$("a."+t.linkClass).remove();u=i.find("."+t.iconClass);t.selectedItem==r&&(n.next().css("display","block"),$("."+t.linkClass,n).attr("aria-expanded","true"),u.removeClass(t.iconExpand).addClass(t.iconCollapse),t.hideTitle==!0&&i.find("."+t.titleTextClass).css("display","none"),t.hideSubTitle==!0&&i.find("."+t.subTitleTextClass).css("display","none"));t.showIcon==!1&&u.css("display","none");t.iconLocation=="left"?u.addClass("leftAlign"):u.addClass("rightAlign");a=$("."+t.contentClass,i);n.find("a#"+h).bind("click",{dataObj:n,settings:t},e);r++;u.parents(".no-arrow").length>0&&u.remove()}),this.childCount=r-1,this.resize();n&&n()};Accordian.prototype.toggle=function(n){var r=n.data.dataObj,t=n.data.settings,u,i;r.is("tr")?(u=r.parent(),i=r,u.find("tr."+t.titleClass).each(function(){var u=$(this),n=u.next(),r;n.hasClass(t.contentClass)&&(r=u.find("td."+t.iconClass),u.index()==i.index()?n.css("display")=="none"?(u.hasClass(t.lastClass)&&(i.removeClass(t.lastClass),n.addClass(t.lastClass)),n.show(),r.removeClass(t.iconExpand).addClass(t.iconCollapse)):t.selfClose==!0&&(n.hasClass(t.lastClass)&&(n.removeClass(t.lastClass),i.addClass(t.lastClass)),n.hide(),r.removeClass(t.iconCollapse).addClass(t.iconExpand)):(n.css("display")=="block"||n.css("display")=="table-row")&&(n.hide(),r.removeClass(t.iconCollapse).addClass(t.iconExpand)));r.parents(".no-arrow").length>0&&r.remove()})):(u=r.parent().parent(),i=r.parent(),$("."+t.itemClass,u).each(function(){var n=$(this),r=$("."+t.contentClass,n),u=$("."+t.iconClass,n),f=$("."+t.titleTextClass,n),e=$("."+t.subTitleTextClass,n),o=$("."+t.linkClass,n);n.is(i)?r.css("display")=="none"?(r.slideDown(),o.attr("aria-expanded","true"),u.removeClass(t.iconExpand).addClass(t.iconCollapse),t.hideTitle==!0&&f.css({display:"none"}),t.hideSubTitle==!0&&e.css({display:"none"})):(t.selfClose==!0||t.collapsable==!0)&&(r.slideUp(),o.attr("aria-expanded","false"),u.removeClass(t.iconCollapse).addClass(t.iconExpand),t.hideTitle==!0&&f.css({display:"block"}),t.hideSubTitle==!0&&e.css({display:"block"})):t.collapsable==!1&&r.css("display")=="block"&&(r.slideUp(),o.attr("aria-expanded","false"),u.removeClass(t.iconCollapse).addClass(t.iconExpand),t.hideTitle==!0&&f.css({display:"block"}),t.hideSubTitle==!0&&e.css({display:"block"}));u.parents(".no-arrow").length>0&&u.remove()}))};Accordian.prototype.resize=function(n){var t=n!=null&&n!=""?n.data.settings:this.settings,i=t.node,u=i.find("."+t.leftClass),f=i.find("."+t.rightClass),r=i.find("."+t.middleClass),e=i.width(),o=u.width()+f.width(),s=parseInt(r.css("padding-left"))+parseInt(r.css("padding-right"))};Accordian.prototype.listen=function(n,t){var e,i,u,r;if(n.keyCode==37)n.preventDefault(),i=parseInt(t[1]),i=i>1?i-1:this.childCount,e=t[0]+"_link_"+i,r=$("a#"+e),r.focus();else if(n.keyCode==39)n.preventDefault(),i=parseInt(t[1]),i=i<this.childCount?i+1:1,u=t[0]+"_link_"+i,r=$("a#"+u),r.focus();else if(n.keyCode==27){n.preventDefault();var u=t[0]+"_link_"+this.childCount,r=$("a#"+u),f=$("a"),o=f.index(r);f.length>o&&f.eq(o+1).focus()}};Accordian.prototype.setNode=function(n){this.settings.node=n};Accordian.prototype.setItemClass=function(n){this.settings.itemClass=n};Accordian.prototype.setTitleClass=function(n){this.settings.titleClass=n};Accordian.prototype.setSubTitleClass=function(n){this.settings.subTitleClass=n};Accordian.prototype.setContentClass=function(n){this.settings.contentClass=n};Accordian.prototype.setLinkClass=function(n){this.settings.linkClass=n};Accordian.prototype.setLeftClass=function(n){this.settings.leftClass=n};Accordian.prototype.setMiddleClass=function(n){this.settings.middleClass=n};Accordian.prototype.setRightClass=function(n){this.settings.rightClass=n};Accordian.prototype.setTitleTextClass=function(n){this.settings.titleTextClass=n};Accordian.prototype.setSubTitleTextClass=function(n){this.settings.subTitleTextClass=n};Accordian.prototype.setIconClass=function(n){this.settings.iconClass=n};Accordian.prototype.setIconExpand=function(n){this.settings.iconExpand=n};Accordian.prototype.setIconCollapse=function(n){this.settings.iconCollapse=n};Accordian.prototype.setSelfClose=function(n){this.settings.selfClose=n};Accordian.prototype.setCollapsable=function(n){this.settings.collapsable=n};Accordian.prototype.setHideTitle=function(n){this.settings.hideTitle=n};Accordian.prototype.setHideSubTitle=function(n){this.settings.hideSubTitle=n};Accordian.prototype.setShowIcon=function(n){this.settings.showIcon=n};Accordian.prototype.setIconLocation=function(n){this.settings.iconLocation=n};Accordian.prototype.setSelectedItem=function(n){this.settings.selectedItem=n};Accordian.prototype.setClickableColumns=function(n){this.settings.clickableColumns=n};Accordian.prototype.setLastClass=function(n){this.settings.lastClass=n};Accordian.prototype.setHeadingLevel=function(n){this.settings.headingLevel=n};I18n.prototype.init=function(){try{var n=this,t=jQuery.ajax({url:n.settings.src,type:n.settings.method,data:{page:n.settings.page},dataType:n.settings.dataType,async:!1});t.done(function(t){if(n.settings.dataType=="json")n.vars=t;else throw"This data type is not yet implemented";});t.fail(function(){throw"Language file loading failed.";})}catch(i){this.exception=i}};I18n.prototype.setSrc=function(n){this.settings.src=n};I18n.prototype.setDataType=function(n){this.settings.dataType=n};I18n.prototype.setPage=function(n){this.settings.page=n};I18n.prototype.setMethod=function(n){this.settings.method=n};DeviceIdentifierClass.prototype.init=function(){var t=$("<div>"),n;t.attr("id",this.settings.mobileOnlyDivID);t.addClass(this.settings.mobileOnlyCssClass);n=$("<div>");n.attr("id",this.settings.tabletOnlyDivID);n.addClass(this.settings.tabletOnlyCssClass);$("body").append(t,n)};DeviceIdentifierClass.prototype.isDesktop=function(){return!this.isMobile()&&!this.isTablet()};DeviceIdentifierClass.prototype.isMobile=function(){var n=$("#"+this.settings.mobileOnlyDivID);return n.css("display")=="block"};DeviceIdentifierClass.prototype.isTablet=function(){var n=$("#"+this.settings.tabletOnlyDivID);return n.css("display")=="block"};TextSizeChangeDetector.prototype.init=function(){this.referenceElement=$("<span>&nbsp;<\/span>");this.referenceElement.css("font-size","1em");this.referenceElement.css("position","absolute");this.referenceElement.css("left","-1000px");$("body").append(this.referenceElement);window.setInterval($.proxy(this.onTextSizeChange,this),500);this.hasInitialized=!0};TextSizeChangeDetector.prototype.addListener=function(n){this.listeners.push(n);this.hasInitialized&&this.onTextSizeChange()};TextSizeChangeDetector.prototype.onTextSizeChange=function(){var t=parseInt(this.referenceElement.css("font-size")),n;if(t!=this.previousSize){for(n=0;n<this.listeners.length;n++)this.listeners[n](this.previousSize,t);this.previousSize=parseInt(t)}};downloadDisclaimerBox=null;countrySelectorV2=null;lang=new I18n;lang.setSrc("/i18n-js");lang.setPage("global");lang.init();var deviceRange=[640,768],linkbox=null,lastClick=null,content="",ajaxStatusUpdateLoading="Loading results.",ajaxStatusUpdateSuccess="The results have been loaded.";$(document).ready(function(){function c(){$(window).width()<=960&&$(window).width()>768||$(window).width()<=960&&document.all&&!document.addEventListener?$(".container").addClass("container-scrollable"):$(".container").removeClass("container-scrollable")}function s(){var n=$(".related-content").height()-59;$(".content-wrapper>.content").css("min-height",n)}function i(t){var r,i;t=t.replace("/"," ").replace("\\"," ").replace("<"," ").replace(">"," ").replace("&"," ");r="/search?search="+encodeURIComponent(t)+"&ref="+encodeURIComponent(window.location.pathname);$("#ClientWidth").val(n);$("#searchSection").val("global");$("#Search").val(t);i="?Search="+$("#Search").val()+"&FooterSearch="+$("#FooterSearch").val()+"&ClientWidth="+$("#ClientWidth").val();window.location.href=window.location.pathname+i}function v(){window.innerWidth<=640&&$("h1.title").each(function(){$(this).html()==$(this).text()&&$(this).html($(this).text().replace("PricewaterhouseCoopers","Pricewaterhouse&shy;Coopers"))})}var n=$(document).width(),h=new Accessibility,r,u,f,e,o,t,l,a;h.detectImageEnabled();h.exception!=null;$(".newsroomArticle").each(function(){var i=$(this).find(".introduction"),t=$(this).find(".content-newsroom");i.append(t.children("p:first"));n<=640&&i[0]&&t.html().trim()&&(i.append('<p><a href="#" class="mbOnly moreInfoBtn fullStory"><span>Load full story<\/span><\/a><\/p>'),t.hide(),$(".fullStory").click(function(n){n.preventDefault();$(this).hide();t.show()}))});$("p.profile-info").each(function(n,t){var i=$(t);i.html().trim()==""&&i.addClass("display-none")});$("p.caption").each(function(n,t){var i=$(t);i.html().trim()==""&&i.addClass("display-none")});$(document).on("click","a",function(){var i,r,u,o,f,e,t,n;$(this).hasClass("do-not-track-now")?$(this).removeClass("do-not-track-now"):$(this).attr("href")!==undefined&&(i=$(this).attr("href"),r=window.location.href,$(this).closest("header.header").length>0?$(this).attr("id")=="SearchButton"||$(this).parent().hasClass("mobi-search")||$(this).hasClass("menu-btn")||(t=$(this).closest(".navi-group").find("a").first().text().trim()+"|",t=="|"&&(t=""),n=getLinkNameForWT($(this)).replace(" last item in this group",""),dcsMultiTrack("WT.cta","Masthead|"+t+n,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)):$(this).closest("footer.footer").length>0?$(this).attr("id")=="FooterSearchButton"||(t=$(this).closest(".links-block>div").find(".nav-section-title").first().text().trim()+"|",t=="|"&&(t=""),n=getLinkNameForWT($(this)),dcsMultiTrack("WT.cta","Footer|"+t+n,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)):$(this).hasClass("accordian")||$(this).hasClass("btand_link")||$(this).parent().hasClass("accordion-header")?(n=getLinkNameForWT($(this)),u="",$(this).hasClass("accordian")?u=$(this).find(".expandable_icon").length==0?"open":"close":$(this).hasClass("btand_link")?u="open":$(this).parent().hasClass("accordion-header")&&(u=$(this).parent().hasClass("expanded")?"open":"close"),dcsMultiTrack("WT.cta","Accordion|"+n+"|"+u,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)):$(this).hasClass("share-icon")?(o=$(this).text().replace(/[^A-Za-z]+/gi,""),t=getSectionNameForWT(),dcsMultiTrack("WT.cta","Share|"+o,"WT.z_cta_section",t,"WT.dl","99")):$(this).hasClass("selectCountryLightBox")||$(this).hasClass("btn-select-country")?$(this).closest(".quick-links").length>0?(f=$(this).parent().find("h3").text().trim(),e="",f=="Commercial Banking"?e="HGHQ_Hql1.2_On":f=="Retail Banking and Wealth Management"&&(e="HGHQ_Hql4.2_On"),dcsMultiTrack("WT.cta","Country Selector Popup: "+f,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r,"WT.ac",e)):dcsMultiTrack("WT.cta","Country Selector Popup","WT.z_cta_loc",i,"WT.dl","99","WT.es",r):$(this).closest(".messagebox_content").find(".countryList").length>0?(n=getLinkNameForWT($(this)),dcsMultiTrack("WT.cta","Country Selector: "+n,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)):$(this).attr("href").substr(0,4)!="http"||$(this).closest(".external-link").length!=0||$(this).closest(".countryList").length!=0||isSameDomain($(this).attr("href"))?$(this).closest(".external-link").length>0?(n=getLinkNameForWT($(this)),dcsMultiTrack("WT.cta","Offsite Link: "+n,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)):($(this).attr("href").charAt(0)=="#"||$(this).attr("href").substr(0,11)=="javascript:")&&!($(this).closest(".pagination").length>0||$(this).parent().hasClass("numeric")||$(this).parent().hasClass("first")||$(this).parent().hasClass("previous")||$(this).parent().hasClass("next")||$(this).parent().hasClass("last"))||$(this).closest(".filter-section").length>0||(t=getSectionNameForWT(),n=getLinkNameForWT($(this)),dcsMultiTrack("WT.cta",t+"|"+n,"WT.z_cta_loc",i,"WT.dl","99")):(n=getLinkNameForWT($(this)),dcsMultiTrack("WT.cta","Offsite Link Popup: "+n,"WT.z_cta_loc",i,"WT.dl","99","WT.es",r)))});if($("a.page-link,a.link-aside").append("<span class='arrow' ><\/span>"),$("a.print").bind("click",function(n){n.preventDefault();window.print()}),r=$(".input-default input, input.input-default").not(".searchdup, .searchNewsroom"),r.each(function(){$(this).data("inputText",$(this).val())}),r.bind("focus",function(){var n=$(this),t=$(this).data("inputText");t==""&&(t=n.val()!=""?n.val():"");t==n.val()&&n.val("")}),r.bind("blur",function(){var n=$(this).data("inputText");$(this).val()==""&&($(this).val(n),n="")}),$(".btn-select-country-2").length==0&&(u=$(".wrapper-selectors.mobile-only"),u.length>0&&(f=u.first(),$(".selectCountryLightBox").each(function(n,t){$(t).parent().append(f.clone())}),f.remove())),e=new FormDesigner(""),e.setNode($(".btn-default")),e.init(),n<=768&&$(".select-default").focus(function(){$(".dd-navi").css("display","none");$(".navi-group").removeClass("menu-act")}),$(window).resize(function(){onDevice();s();c();v()}),$(window).bind("deviceChanged",function(){onDeviceChange()}),$(".scroller").bind("click",function(n){n.preventDefault();var t=$(this).attr("data-scrollTo");t=t!==undefined?t:0;$("html, body").animate({scrollTop:t},300);$("html, body").focus()}),o=$("html").hasClass("ie6"),$(".shareIcons").css("display","none"),navigator.userAgent.indexOf("WOW64")!=-1||navigator.userAgent.indexOf("Win64")!=-1?$("body").addClass("bit64"):$("body").addClass("bit32"),navigator.userAgent.indexOf("Firefox")!=-1&&$("body").addClass("firefox"),t=!1,o==!1&&(t||$(".share").unbind("click").bind("mouseenter",function(n){n.preventDefault();var t=$(this),i=t.next(".shareIcons");t.parent().before("<div class='share-overlay'><\/div>");$(".share-overlay").width($(document).width());$(".share-overlay").height($(document).height());$(".share-overlay").bind("mouseenter",{obj:t},function(n){n.preventDefault();var t=n.data.obj,i=t.next(".shareIcons");i.css("display")=="block"&&(i.fadeOut(),t.find(".screen-reader-only").text("click to expand"));$(".share-overlay").remove()});i.css("display")=="none"&&(i.slideDown(),t.find(".screen-reader-only").text("click to collapse"))})),$(".share").unbind("mouseenter").bind("click",function(n){n.preventDefault();var i=$(this),r=i.next(".shareIcons");r.css("display")=="none"?(t=!0,i.find(".screen-reader-only").text("click to collapse"),r.slideDown(),o==!1&&(i.parent().before("<div class='share-overlay'><\/div>"),$(".share-overlay").width($(document).width()),$(".share-overlay").height($(document).height()),$(".share-overlay").bind("click",{obj:i},function(n){n.preventDefault();var t=n.data.obj,i=t.next(".shareIcons");i.css("display")=="block"&&(i.fadeOut(),t.find(".screen-reader-only").text("click to expand"));$(this).remove()}))):(t&&(r.fadeOut(),i.find(".screen-reader-only").text("click to expand"),$(".share-overlay").length>0&&$(".share-overlay").remove()),t=!1)}),$(".title-content .print").bind("focus",function(){$(".share-overlay").length>0&&($(this).prev().find(".shareIcons").fadeOut(),el.find(".screen-reader-only").text("click to expand"),$(".share-overlay").remove(),t=!1)}),$("#SearchButton").click(function(n){n.preventDefault();i($("#Search").val())}),$("#Search").keyup(function(n){n.keyCode==13&&(n.preventDefault(),i($(this).val()))}),$(".mobi-search-input").keyup(function(n){n.keyCode==13&&(n.preventDefault(),i($(this).val()))}),$("#FooterSearchButton").click(function(n){n.preventDefault();i($("#FooterSearch").val())}),$("#FooterSearch").keyup(function(n){n.keyCode==13&&(n.preventDefault(),i($(this).val()))}),$(".searchdup").keyup(function(n){n.keyCode==13&&(n.preventDefault(),i($(this).val()))}),$("#Form1").submit(function(){$("#ClientWidth").val(n)}),c(),s(),$(".related-content").find("img").bind("error load",function(){s()}),linkbox=new MessageBox,l="<table cellpadding='0' cellspacing='0' width='100%'>\t<tr><td class='msgBoxTopLeft'><\/td><td class='msgBoxTopMiddle' width='100%'><\/td><td class='msgBoxTopRight'><a href='/' id='closeButton' class='closeButton'>close dialog<\/a><\/td><\/tr>\t<tr><td class='imgWhite'><\/td><td class='msgBoxMiddleMiddle'><!--content--><\/td><td class='imgWhite'><\/td><\/tr>\t<tr><td class='msgBoxBottomLeft'><\/td><td class='msgBoxBottomMiddle'><\/td><td class='msgBoxBottomRight'><\/td><\/tr>\t<\/table>",linkbox.setEnableTemplates(!0),linkbox.setOverlayClass("linkbox_overlay"),linkbox.setTemplate(l),linkbox.setContentClass("external-link"),n>640?(linkbox.setTop("200px"),linkbox.setLeft("auto")):(linkbox.setTop(0),linkbox.setLeft(0)),linkbox.setOverlayInlineCss(""),linkbox.setContentInlineCss(""),a=function(){var n=new FormDesigner;n.setNode($(".go-to-site"));n.init();$("a.closeButton, .pageClose").bind("click",function(n){n.preventDefault();linkbox.hide()})},linkbox.setCallback(a),linkbox.setContent($(".data-loader-container")),linkbox.init(),linkbox.exception==null)$(document).on("click","a",function(n){var t=$(this),i=t.attr("href");i===undefined||t.hasClass("no-popup")!=!1||t.hasClass("link-download")!=!1||i.indexOf("http")!=0||isSameDomain(i)||$(this).closest(".msgBoxMiddleMiddle").length!=0||(n.preventDefault(),lastClick=t,linkbox.setTriggerElement(n.target),handleLink(i))});v();onDeviceChange();window.prevWidth=n;initializeCountrySelectorV2()});var handleLink=function(n){var i=window.location.host,r=new RegExp(i+"(?!\\.)","g"),u=r.test(n),t;n.indexOf("http")==0&&u==!1?(linkbox.setPostData("url="+encodeURIComponent(n)),linkbox.load("/external-link"),linkbox.show(),t=$("#accessibilityToolTip"),t.length>0&&t.remove()):window.location=n},onDevice=function(){for(var r=$(document).width(),t=0,i=0,n=0;n<deviceRange.length;n++)n==0?(window.prevWidth<=deviceRange[n]&&t==0&&(t=deviceRange[n]),r<=deviceRange[n]&&i==0&&(i=deviceRange[n])):(window.prevWidth>deviceRange[n-1]&&window.prevWidth<=deviceRange[n]&&t==0?t=deviceRange[n]:window.prevWidth>deviceRange[n]&&t==0&&(t=deviceRange[n]+1),r>deviceRange[n-1]&&r<=deviceRange[n]&&i==0?i=deviceRange[n]:r>deviceRange[n]&&i==0&&(i=deviceRange[n]+1));t!=i&&$(window).trigger("deviceChanged");pageWidth=$("html").hasClass("ie")?1070:1060;r<pageWidth?$("body").hasClass("act-scroll")==!1&&$("body").addClass("act-scroll"):($("body").hasClass("act-scroll"),$("body").removeClass("act-scroll"));window.prevWidth=r},onDeviceChange=function(){function c(n){var i,t;n=n.replace("/"," ").replace("\\"," ").replace("<"," ").replace(">"," ").replace("&"," ");i="/search?search="+encodeURIComponent(n)+"&ref="+encodeURIComponent(window.location.pathname);$("#ClientWidth").val(r);$("#searchSection").val("global");$("#Search").val(n);t="?Search="+$("#Search").val()+"&FooterSearch="+$("#FooterSearch").val()+"&ClientWidth="+$("#ClientWidth").val();window.location.href=window.location.pathname+t}var r=$(document).width(),h=new FormDesigner,i,f;if(h.setNode($(".input-default")),h.init(),i=new FormDesigner,i.setNode($(".select-default")),r>768&&(i.setCustomDropDown(!0),i.setCustomScroll(!0),i.setJSPositioning(!1)),i.init(),r>640?(linkbox.setTop("200px"),linkbox.setLeft("auto")):(linkbox.setTop(0),linkbox.setLeft(0)),r<=640){var n=$(".mobi-search .mobi-search-input"),u=$(".mobi-search .title"),t=$(".navigation"),s=n.val(),v=n.width();t.css("display","none");n.css("display","none");u.css("display","block");$(".menu-overlay").css("display","none");$(".menu-btn").unbind().bind("click",function(i){i.preventDefault();$(".dd-navi",t).css("display","none");n.css("display")=="block"&&(n.css("display","none"),u.css("display","block"));t.slideToggle()});$(".mobi-search .search-btn").unbind().bind("click",function(i){if(i.preventDefault(),n.css("display")=="none")t.css("display")=="block"&&($(".dd-navi",t).css("display","none"),t.css("display","none")),u.css("display","none"),n.css("display","block");else{var r=n.val();r==s?(n.css("display","none"),u.css("display","block")):(searchNewsroom=$("input.searchNewsroom"),searchNewsroom.length>0&&searchNewsroom.val(r),c(r))}});$(".mobi-search .mobi-search-input").unbind().bind("keydown",function(n){var i=n.keyCode||n.which,t=$(this).val();i==13&&(n.preventDefault(),searchNewsroom=$("input.searchNewsroom"),searchNewsroom.length>0&&searchNewsroom.val(t),c(t))});n.bind("focus",function(){var n=$(this).val();n==s&&$(this).val("")});n.bind("blur",function(){var n=$(this).val();n==""&&$(this).val(s)});$(".navigation > li").unbind().bind("click",function(n){var i=$(this),r=$(".dd-navi",i),f=$(".dd-navi",i.siblings("li")),e=$(".col-two",t),u=n.target;f.stop(!0,!0,!0).slideUp(500);i.siblings().removeClass("menu-act");r.css("display")=="none"?(n.preventDefault(),i.find("a").first().addClass("do-not-track-now"),i.addClass("menu-act"),e.css("display","none"),r.stop(!0,!0,!0).slideDown(500)):($(u).hasClass("arrow")&&n.preventDefault(),$(u).hasClass("dd-navi")==!1&&$(u).parents().hasClass("dd-navi")==!1&&(r.stop(!0,!0,!0).slideUp(500),i.removeClass("menu-act")))});$(".col-one > li").unbind().bind("click",function(n){var t=$(this),i=$("ul",t),u=$("ul",t.siblings("li")),r=n.target;$(".col-one > li").removeClass("sub-menu-act");u.stop(!0,!0,!0).slideUp(500);i.css("display")=="none"?(i.children().length>0&&(n.preventDefault(),t.find("a").first().addClass("do-not-track-now")),i.stop(!0,!0,!0).slideDown(500),t.addClass("sub-menu-act")):($(r).hasClass("arrow")&&i.children().length>0&&n.preventDefault(),$(r).hasClass("col-two")==!1&&$(r).parents().hasClass("col-two")==!1&&(i.stop(!0,!0,!0).slideUp(500),t.removeClass("sub-menu-act")))})}else{window.insideMenu=!1;f=null;$(".navigation").css("display","block");var l=function(n,t){var i=$("html").hasClass("ie6");$(".menu-overlay").length<=0&&i==!1&&(n.before("<div class='menu-overlay'><\/div>"),$(".menu-overlay").width($(document).width()),$(".menu-overlay").height($(document).height()),$(".menu-overlay").unbind().bind(t,function(){window.insideMenu?($(".dd-navi").stop(!0,!0,!0).css("display","none"),$(".header .select-default select").css("display","block")):$(".dd-navi").stop(!0,!0,!0).slideUp(500);$(".navigation > li").removeClass("menu-act menu-act-next");window.insideMenu=!1;$(this).css("display","none")}))},e=function(n){var i=n.type,t=$(this),u=t.next("li"),r=$(".dd-navi",t),o=$(".dd-navi",t.siblings("li")),s=$(".navigation .col-two"),e=t.parent(),h=$(".menu-overlay");$(".header .select-default select").css("display","none");i=="click"&&r.css("display")=="none"&&(n.preventDefault(),o.stop(!0,!0,!0).css("display","none"),f!=null&&f.removeClass("menu-act"),s.css("display","none"));$(".navigation > li").removeClass("menu-act-next");u.length>0&&u.addClass("menu-act-next");h.css("display","block");t.addClass("menu-act");window.insideMenu?(r.stop(!0,!0,!0).css("display","block"),l(e,i)):(window.insideMenu=!0,r.stop(!0,!0,!0).slideDown(500,function(){l(e,i)}));f=t},a=function(n){var t=$(this),i=t.next("li"),r=$(".dd-navi",t),u=$(".navigation .col-two"),f=$(n.target);$(".header .select-default select").css("display","block");setTimeout(function(){i.length>0&&i.removeClass("menu-act-next");t.removeClass("menu-act");u.css("display","none");window.insideMenu?r.stop(!0,!0,!0).css("display","none"):r.stop(!0,!0,!0).slideUp(500)},50)},o=function(n){var r=n.type,i=$(this),t=$("ul",i),u=$("ul",i.siblings("li")),f=n.target;r=="click"&&t.css("display")=="none"&&t.children().length>0&&n.preventDefault();u.css("display","none");$(".col-one > li").removeClass("sub-menu-act");t.css("display")=="none"&&(t.css("display","block"),i.addClass("sub-menu-act"))};r<=768?($(".navigation > li").unbind("mouseenter"),$(".navigation > li").unbind("mouseleave"),$(".col-one > li").unbind("mouseenter"),$(".navigation > li").unbind("click",e).bind("click",e),$(".col-one > li").unbind("click",o).bind("click",o),$(".videoPlayer").each(function(){$(this).find("embed").attr("width","470").attr("height","264")})):($(".navigation > li").unbind("mouseenter",e).bind("mouseenter",e),$(".navigation > li").unbind("mouseleave",a).bind("mouseleave",a),$(".col-one > li").unbind("mouseenter",o).bind("mouseenter",o))}};$(document).ready(function(){var n=function(){var t=$(document).width(),i=$(".footer .links-block"),n=$(".footer .quick-links-services"),r=i.height()-parseInt(n.css("padding-top"))-parseInt(n.css("padding-bottom"));t>=1024?n.height(r):n.removeAttr("style")};n();$(window).resize(n);$("a.print, #print-this-site").unbind("click").bind("click",function(n){return n.preventDefault(),window.print(),!1});$(".revamp .content-body .elevated-block").each(function(){$(".profile-wrapper",this).last().css({marginBottom:0})}),function(n){n.fn.nowrapper=function(){return this.each(function(){var o="nowrap",s=function(n,t){var i=t.split(" "),r=i.pop(),u='<span class="'+n+'"><\/span>';return i.join(" ")+' <div class="'+o+'">'+r+u+"<\/div>"},r=n(this).attr("class"),t=n(this).parent(),h=t.html(),u,f=n("span.acc-hidden, span.screen-reader-only",t),i="";f.length>0&&(i=" "+n("<div>").append(f).html());var u=t.text().trim(),e=s(r,u),c=new RegExp("<span class=([\"']){0,}bold([\"']){0,}>.+<\/span><span class=([\"']){0,}"+r+"([\"']){0,}><\/span>","i");c.test(n.trim(h))?t.html('<span class="bold">'+e+i+"<\/span>"):t.html(e+i)})};n(".content-wrapper a span.arrow, .content-wrapper a span.arrow-right, .content-wrapper a span.arrow-white, .content-wrapper a span.white-arrow, .content-wrapper a span.red-arrow, .content-wrapper a span.link-icon").nowrapper()}(jQuery);$(".content-wrapper a").each(function(){var i=$(this),r,u,t,f,n;i.find(".screen-reader-only").length==0&&(r=i.attr("title"),u=r!=null?$.trim(r).toLowerCase():"",u.length!=0&&(t=$.trim(i.text()).toLowerCase(),t!=null&&t.length!=0&&(f=getLinkTextDataForHiddenText(t,u),f!=null&&(n=f.preposition,n=n==null?"about":n,(t.substr(t.length-n.length,n.length)==n||u.substr(0,n.length)==n)&&(n=""),i.append('<span class="screen-reader-only">'+n+" "+r+"<\/span>")))))});processImageCredits();$(document).ajaxComplete(function(){processImageCredits()});$(".content-wrapper").on("mouseenter",".credited-image-wrapper",function(){$(window).width()>768&&$(this).find(".credit-line").slideDown(100)});$(".content-wrapper").on("mouseleave",".credited-image-wrapper",function(){$(window).width()>768&&$(this).find(".credit-line").slideUp(100)});$("a","#landing-page").attr("tabindex",1);$("#PrimaryRHSSection a","#landing-page").attr("tabindex",2);$("#SecondaryRHSSection a","#landing-page").attr("tabindex",3);$("#SecondaryContentSection a","#landing-page").attr("tabindex",4);$(".container>footer.footer").parent().children("#landing-page").length>0&&$("footer a, footer input").attr("tabindex",5)}),function(n){n(document).ready(function(){var t=function(t){var i=n(t.selector),r;i.length!==0&&(r=function(n){var i,t;if(n.limitTo.length===0)return!0;for(i=n.limitTo.split("|"),t=0;t<i.length;t++)if(window.location.pathname===i[t])return!0;return!1},r(t)&&i.bind(t.eventType,function(e){t.preventDefault&&e.preventDefault();eval(t.toEval)}))};n.getJSON("/~/media/HSBC-com/webtrends.json",function(n){if(typeof n.EventsCollection!="undefined"&&n.EventsCollection.length>0)for(var i=0;i<n.EventsCollection.length;i++)t(n.EventsCollection[i])})})}(jQuery);$(document).ready(function(){$("img.lazy-momo").show();$("img.lazy-momo").forceRatio();$("img.lazy-momo").lazyMomo(0,!0)});$(document).ready(function(){WTSearchAndFilteringTracking()});$(document).ready(function(){var t=navigator.userAgent.match(/iPad/i)!=null,n;t&&(n=parseInt($(".dd-navi").width())-20,$(".dd-navi").width(n))});RHSDynamicRelocator.prototype.init=function(){if(this.rhsElement!=null&&this.rhsElement.length>0){this.resetLocation();this.relocate();var n=$(window).width(),t=$(window).height(),i=this;$(window).unbind("resize").bind("resize",function(){var r=$(window).width(),u=$(window).height();(n!=r||t!=u)&&i.relocate();n=r;t=u})}};RHSDynamicRelocator.prototype.updateSettings=function(n,t){this.settings=$.extend({relocateOnTablet:!1,mobileCss:null,tabletCss:null},n);t&&this.relocate()};RHSDynamicRelocator.prototype.relocate=function(){var t=!1,n=this.rhsElement,i;n!=null&&this.rhsElement.length>0&&(n.removeAttr("style"),this.isArticlePage?deviceIdentifier.isMobile()?($("#content-section").append(n),this.settings.mobileCss&&n.css(this.settings.mobileCss)):deviceIdentifier.isTablet()?this.settings.relocateOnTablet?(i=this.getChildrenWidth(),this.settings.tabletCss?($("#PrimaryContentSection").before(n),n.css(this.settings.tabletCss)):($("#content-section").append(n),n.css({float:"left",position:"static"}),n.css({width:i+100,"margin-left":"24px","margin-top":"24px"}))):t=!0:t=!0:(t=!0,deviceIdentifier.isTablet()&&$(".related-content .general-links-block:nth-child(2)").addClass("general-links-block-size")),t&&this.resetLocation())};RHSDynamicRelocator.prototype.resetLocation=function(){var t=this.rhsElement,r,i,n;this.isArticlePage&&$("#PrimaryContentSection").before(t);t.length>0&&t.attr("style","");r=!1;deviceIdentifier.isDesktop()?r=!0:!this.isArticlePage&&deviceIdentifier.isTablet()&&(t.parents(".faqs").length>0||t.parents(".individual-profile").length>0)&&(r=!0);r&&(i=$("#social-buttons"),i.length==0&&(i=$(".title-content")),i.length>0&&t.length>0&&(t.css("margin-top","0px"),n=i.offset().top,n=t.offset().top-n,n>0?n="-"+n:n*=-1,n=n+"px",t.css("margin-top",n)))};RHSDynamicRelocator.prototype.getChildrenWidth=function(){var n=0;return this.rhsElement.children().each(function(){n=n+$(this).width()}),n};var ticker=null,deviceIdentifier,rhsDynamicRelocator=null,textSizeChangeDetector=null;if($(document).ready(function(){deviceIdentifier=new DeviceIdentifierClass;rhsDynamicRelocator=new RHSDynamicRelocator;initializeDownloadDisclaimer();setUpDropdownGoLink();SocialButtonheight();$(".rationalised")[0]&&(tickerAtGlane(),setMarginIfImagesOnlyInRHS(),addIconsToImages(),addLinkIconsToLinks(),addWebTrendTagsToLinks(),addWebTrendTagsToImages(),changeSpacingForContentModuleAfterBannerOnArticlePage(),organiseExpandableModules(),handleVideoImage(),triggerDeviceView(),changeHeightOfBreadcrumb(),initAccordions(),$(window).bind("deviceChanged",function(){triggerDeviceView();changeHeightOfBreadcrumb();standardizeSectionHeadlineHeights()}));deviceIdentifier.isDesktop()&&(textSizeChangeDetector=new TextSizeChangeDetector,textSizeChangeDetector.addListener(function(n,t){var i=$("body"),u="text-font-large",f="is-larger",e="is-largest",r,o;t>16?(i.hasClass(u)||i.addClass(u),i.removeClass(f),i.removeClass(e),r=f,t>=21&&(r=e),i.hasClass(r)||i.addClass(r)):(i.removeClass(u),i.removeClass(f),i.removeClass(e));o=function(){rhsDynamicRelocator!=null&&rhsDynamicRelocator.relocate();standardizeSectionHeadlineHeights()};$("html").hasClass("ie8")?setTimeout(o,500):o()}),textSizeChangeDetector.init())}),$(window).load(function(){rhsDynamicRelocator||(rhsDynamicRelocator=new RHSDynamicRelocator);standardizeSectionHeadlineHeights();rhsDynamicRelocator.init()}),brightcoveVideoPlayers={},!function(n,t,i){var r={settings:{elementClassName:"momo",className:"momo-lightbox",imgClassName:"momo-image",closeClassName:"momo-close",overlayClassName:"momo-overlay",infographicOverlayClassName:"momo-infographic-overlay",infographicContainerClassName:"momo-infographic-container",infographicClassName:"momo-infographic",infographicHolderClassName:"momo-infographic-holder",$appendTo:i("body"),template:function(){return'<div class="'+this.className+'" id="{momoId}" data-origin="{originId}"><div class="'+r.settings.overlayClassName+'"><\/div><div class="'+this.closeClassName+'"><\/div><div class="momo-dialog"><div class="momo-dialog-content-wrapper"><div class="momo-dialog-content">{content}<\/div><\/div><\/div><\/div>'},imgTemplate:function(){return'<img class="'+this.imgClassName+'" src="{imgSrc}" alt="">'},iframeTemplate:function(){return'<iframe src="{target}" frameborder="0" marginheight="0" marginwidth="0"><\/iframe>'},loadingClassName:"momo-loading",loadingOverlayTemplate:function(){return'<div class="'+this.loadingClassName+'"><div class="momo-loading-bar"><\/div><\/div>'},width:"auto",height:"auto",padding:"auto"},browserWindow:{width:n.innerWidth||t.documentElement.clientWidth||t.body.clientWidth,height:n.innerHeight||t.documentElement.clientHeight||t.body.clientHeight},temp:{},_:{displayModes:["normal","iframe","infographic"],defaultPrefix:"momo_",log:{},addLog:function(n,t){void 0===this.log[n]&&(this.log[n]=[]);this.log[n].reverse();this.log[n].push(t);this.log[n].reverse()},getTarget:function(n){return void 0!==i(n).data("target")&&i.trim(i(n).data("target")).length>0?i(n).data("target"):void 0!==i(n).attr("href")&&i.trim(i(n).attr("href")).length>0?i(n).attr("href"):""},getTargetType:function(n,t,r){return"string"==typeof r&&r.length>0&&1===i(r).length?"selector":n.match(/([^\s]+(\.(jpg|png|gif|bmp))($|[?.+$]))/i)?"image":void 0!==t&&"iframe"==t?"iframe":"ajax"},getId:function(n){return(void 0===i(n).attr("id")||0===i(n).attr("id").length)&&i(n).attr("id",this.generateRandomId()),i(n).attr("id")},getCallback:function(n){if(void 0!==i(n).data("callback")){var t=i.trim(i(n).data("callback"));if(t.length>0&&"function"==typeof this.callbacks[t])return t}return""},getDisplayMode:function(n){if(void 0!==i(n).data("display")){var t=i.trim(i(n).data("display"));if(t.length>0&&this.displayModes.indexOf(t)>-1)return t}return"normal"},getAspectRatio:function(n){return void 0!==i(n).data("aspect-ratio")?i.trim(i(n).data("aspect-ratio")):""},getWidth:function(n){return this._getDataNumber(n,"width")},getHeight:function(n){return this._getDataNumber(n,"height")},getPadding:function(n){return this._getDataNumber(n,"padding")},_getDataNumber:function(n,t){return void 0!==i(n).data(t)?parseInt(i(n).data(t)):NaN},getPostData:function(n,t){var r=i.trim(i(n).data("postdata"));return("string"!=typeof t||0===t.length)&&(t=this.getId(n)),r},getSelector:function(n){return void 0!==i(n).data("selector")?i(n).data("selector"):""},getDownloadUrl:function(n){return void 0!==i(n).data("download-url")?i(n).data("download-url"):""},getTextData:function(n,t){return void 0!==i(n).data(t)?i(n).data(t):""},parseParams:function(n){var u,o=/([^&=]+)=?([^&]*)/g,e=function(n){return decodeURIComponent(n.replace(/\+/g," "))},t={},r,f;if(n)for("?"==n.substr(0,1)&&(n=n.substr(1));u=o.exec(n);)r=e(u[1]),f=e(u[2]),void 0!==t[r]?(i.isArray(t[r])||(t[r]=[t[r]]),t[r].push(f)):t[r]=f;return t},generateRandomId:function(n){"string"!=typeof n&&(n=this.defaultPrefix);for(var t=n,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;5>r;r++)t+=i.charAt(Math.floor(Math.random()*i.length));return t},parseTemplate:function(n,t){if("object"==typeof t){var i,r;for(i in t)t.hasOwnProperty(i)&&(r=RegExp("{"+i+"}","i"),n=n.replace(r,t[i]))}return n},wrapContent:function(n,t){return("string"!=typeof t||0===t.length)&&(t="overflow-wrapper"),'<div class="'+t+'">'+n+"<\/div>"},callbacks:{},intervalId:null,momoDialogLastHeight:0,momoDialogLastWidth:0,momoDialogSizeCheck:function(){var n=r._,t=n.getDialogSize();3!==t.length||n.momoDialogLastHeight==t[1]&&n.momoDialogLastWidth==t[0]||(n.dialogCenter(),n.momoDialogLastWidth=t[0],n.momoDialogLastHeight=t[1])},clearMomoDialogSize:function(){this.momoDialogLastWidth=this.momoDialogLastHeight=0},getDialogSize:function(){var t=i("."+r.settings.className),n=i(".momo-dialog",t),u=n.height(),f=n.width();return[f,u,n]},setDialogSize:function(n,t,u,f,e){var c,l,a,v,y;void 0===n&&(n=r.settings.width);void 0===t&&(t=r.settings.height);void 0===u&&(u=r.settings.padding);var b=i("."+r.settings.className),h=i(".momo-dialog",b),o=i(".momo-dialog-content",h),p=i("iframe",o),w=i("object",o),k=i(".overflow-wrapper",o),s=i("img."+r.settings.imgClassName,o);if("auto"==n&&(n=parseInt(h.width())),"auto"==u&&(u=parseInt(o.css("paddingTop"))),o.css({padding:u}),1===s.length&&f)return void this._setDialogSizeForImg(n,t,u,s);1===s.length&&e!==!0&&(c=new Image,l=this,c.onload=function(){var r=this.width/this.height,i;"auto"==t&&"number"==typeof n&&n>0&&(t=n/r,i=l._scaleToFitWindow(n,t,u,!0),n=i[0],t=i[1],l.setDialogSize(n,t,u,!1,!0))},c.src=s.attr("src"));a=this._scaleToFitWindow(n,t,u,f);n=a[0];t=a[1];v=n+2*u;y=t+2*u;v>0&&n>0&&(h.width(v),o.width(n),p.width(n),w.width(n),s.width(n));y>0&&t>0&&(h.height(y),o.height(t),p.height(t),w.height(t),s.height(t),k.height(t))},_scaleToFitWindow:function(n,t,i,u){var f=r.browserWindow.width-50-2*i,e=r.browserWindow.height-50-2*i,o;return(n>f||t>e)&&(u===!0?(o=Math.min(f/n,e/t),n=o*n,t=o*t):(n>f&&(n=f),t>e&&(t=e))),[n,t]},_setDialogSizeForImg:function(n,t,i,r){var u=new Image,f=this;u.onload=function(){var u=this.width/this.height,r;"auto"==t&&"number"==typeof n&&n>0&&(t=n/u);n=t*u;r=f._scaleToFitWindow(n,t,i,!0);n=r[0];t=r[1];f.setDialogSize(n,t,i)};u.src=r.attr("src")},dialogCenter:function(){var n=r._.getDialogSize(),u,f,e,t,o,s;if(3===n.length){var h=i("."+r.settings.className),c=i(".momo-dialog",h),l=i(".momo-dialog-content",c),a=i("img."+r.settings.imgClassName,l);0==a.length&&(u=r.browserWindow.width-50-2*r.temp.padding,f=r.browserWindow.height-50-2*r.temp.padding,n[0]>u&&r._.setDialogSize(u,r.temp.height,r.temp.padding,r.temp.aspectRatio),n=r._.getDialogSize(),n[1]>f&&r._.setDialogSize(r.temp.width,f,r.temp.padding,r.temp.aspectRatio),n=r._.getDialogSize());n[2].css({top:"50%",marginTop:-1*Math.round(n[1]/2),left:"50%",marginLeft:-1*Math.round(n[0]/2)});e="."+r.settings.closeClassName;t=i(e);1===t.length&&(o=t.width(),s=t.height(),i(e).css({marginLeft:o/-2+n[0]/2,marginTop:-1*(s/2+n[1]/2)}))}},jqXHRObj:null},log:function(n){return"string"==typeof n&&n.length>0?this._.log[n]:this._.log},onClick:function(n){n.preventDefault();r.click(this)},onClose:function(n){n.preventDefault();r.close()},click:function(n){if(void 0!==n){var t=this._.getTarget(n),r=this._.getId(n);0===t.length?this._.addLog(n.id,{error:"no target specified"}):this.isDisplayed()?this._.addLog(n.id,{error:"MoMo alredy displayed",target:t}):(this._.addLog(n.id,{info:"target detected",target:t}),this.show(t,{originElementId:r,postData:this._.getPostData(n,r),callbackName:this._.getCallback(n),displayMode:this._.getDisplayMode(n),width:this._.getWidth(n),height:this._.getHeight(n),padding:this._.getPadding(n),aspectRatio:this._.getAspectRatio(n),selector:this._.getSelector(n),downloadUrl:this._.getDownloadUrl(n),title:i(n).attr("title"),wtAc:this._.getTextData(n,"wt-ac")}))}},isDisplayed:function(){return i("."+this.settings.className).length>0?!0:!1},show:function(n,t){if(!this.isDisplayed()&&i.trim(n).length>0){void 0===t&&(t={});var s,u=this,e=this._.getTargetType(n,t.displayMode,t.selector),r="",o=this._.generateRandomId(),f="string"==typeof t.originElementId&&t.originElementId.length>0?t.originElementId:this._.generateRandomId("momo-no-origin_"),h=this._.callbacks[t.callbackName],c="string"==typeof t.selector?t.selector:"";s="object"==typeof t.postData?t.postData:"string"==typeof t.postData?this._.parseParams(t.postData):{};"selector"==e&&(r=this._.wrapContent(i(c).html()),this._display({content:r,momoId:o,originId:f,target:n,width:t.width,height:t.height,padding:t.padding,aspectRatio:t.aspectRatio}));"image"==e&&(r=this._.parseTemplate(this.settings.imgTemplate(),{imgSrc:n}),this._display({content:r,momoId:o,originId:f,target:n,width:t.width,height:t.height,padding:t.padding,aspectRatio:t.aspectRatio,displayMode:t.displayMode,downloadUrl:t.downloadUrl,title:t.title,wtAc:t.wtAc}));"iframe"==e&&(r=this._.parseTemplate(this.settings.iframeTemplate(),{target:n}),this._display({content:r,momoId:o,originId:f,target:n,width:t.width,height:t.height,padding:t.padding,aspectRatio:t.aspectRatio}));"ajax"==e&&(this._displayLoadingOverlay(),this._.jqXHRObj=i.ajax(n,{data:s,type:"GET",error:function(n,t){u._closeLoadingOverlay();u._.addLog(f,{error:"Ajax error: "+t})},success:function(i,e){u._closeLoadingOverlay();"function"==typeof h?r=u._.wrapContent(h(i,e)):("string"==typeof i&&(r=u._.wrapContent(i)),"object"==typeof i&&(r=JSON.stringify(i)));u._display({content:r,momoId:o,originId:f,target:n,width:t.width,height:t.height,padding:t.padding,aspectRatio:t.aspectRatio})}}))}},registerCallback:function(n,t){"string"==typeof n&&"function"==typeof t&&(this._.callbacks[n]=t)},_display:function(n){var u=this.settings.template();u=this._.parseTemplate(u,{content:n.content,momoId:n.momoId,originId:n.originId});this.intervalId=setInterval(this._.momoDialogSizeCheck,50);this.settings.$appendTo.append(u);var o=i("."+this.settings.className),s=i(".momo-dialog",o),v=i("."+this.settings.closeClassName,o),t=i(".momo-dialog-content",s),y=i("iframe",t),h=i("object",t),p=i(".overflow-wrapper",t),f=i("img."+r.settings.imgClassName,t);this._.addLog(n.originId,{info:"momo displayed",target:n.target,content:n.content});t.find(".countryList").length>0&&(t.addClass("isCountrySelector"),n.width=900);void 0!==n.displayMode&&"infographic"==n.displayMode&&(f.addClass("show-as-infographic"),f.trigger("mouseenter",n));s.animate({opacity:1},500);v.css({zIndex:9999});1===h.length&&t.addClass("loading");(1===f.length||1===y.length||1===h.length)&&p.css({overflow:"visible"});this._.clearMomoDialogSize();this._.intervalId=setInterval(this._.momoDialogSizeCheck,100);var c="number"==typeof n.width&&n.width>0?n.width:this.settings.width,l="number"==typeof n.height&&n.height>0?n.height:this.settings.height,e="number"==typeof n.padding&&n.padding>=0?n.padding:this.settings.padding,a="string"==typeof n.aspectRatio&&"true"==n.aspectRatio||"boolean"==typeof n.aspectRatio&&n.aspectRatio;this.temp={};this.temp.width=c;this.temp.heigt=l;this.temp.padding="auto"==e?parseInt(t.css("paddingTop")):e;this.temp.aspectRatio=a;this._.setDialogSize(c,l,e,a)},_displayLoadingOverlay:function(){var n=this.settings.loadingOverlayTemplate();this.settings.$appendTo.append(n)},_closeLoadingOverlay:function(){var n=i("."+this.settings.loadingClassName);n.length>0&&n.remove()},cancelXHR:function(){null!==this._.jqXHRObj&&this._.jqXHRObj.hasOwnProperty("readyState")&&4!=this._.jqXHRObj.readyState&&this._.jqXHRObj.abort()},close:function(){var n=i("."+this.settings.className),t="."+r.settings.infographicContainerClassName;n.length>0&&(void 0!==typeof n.data("origin")&&n.data("origin").length>0&&this._.addLog(n.data("origin"),{info:"momo closed"}),n.momoRemove(),clearInterval(this._.intervalId));i(t).remove()}},o;n.MoMo=r;i.fn.momo=function(n){this.addClass(r.settings.elementClassName);for(var t in n)n.hasOwnProperty(t)&&this.data(t,n[t]);return this};i.fn.momoRemove=function(){this.remove()};i.fn.momoTooltip=function(n){"string"==typeof n&&(n.tooltipText=n);var r=i.extend(i.fn.momoTooltip.defaults,n);return this.each(function(){var u="";if(0===r.tooltipText.length&&this.title.length>0&&(u=this.title),0===u.length)return this;var f,o=this,n="."+r.tooltipClassName,e=function(t){void 0!==t&&clearTimeout(t);i(n).animate({opacity:0},200,function(){i(this).remove()})};i(this).unbind("mouseenter").unbind("mousemove").unbind("mouseleave");i(this).bind("mouseenter",function(){this.title="";i(r.appendTo).append('<div class="'+r.tooltipClassName+'">'+u+"<\/div>");i(n).css(r.tooltipStyle);i(n).animate({opacity:1},300);r.lifetime>0&&(f=setTimeout(function(){i(o).trigger("mouseleave")},r.lifetime))});i(this).bind("mousemove",function(t){r.followMouse&&i(n).css({left:t.pageX+10,top:t.pageY+10})});i(t).delegate("*","keydown",function(n){(27===n.keyCode||27===n.which)&&e()});i(this).bind("mouseleave",function(){e(f)})})};i.fn.momoTooltip.defaults={tooltipText:"",followMouse:!0,tooltipClassName:"momo-tooltip",appendTo:"body",tooltipStyle:{},lifetime:3e3};var s="."+r.settings.overlayClassName,h="."+r.settings.elementClassName,c="."+r.settings.closeClassName,l="."+r.settings.loadingClassName,a="."+r.settings.className+" ."+r.settings.imgClassName,f="."+r.settings.infographicContainerClassName,u="."+r.settings.infographicClassName,e="."+r.settings.infographicHolderClassName,v="."+r.settings.infographicOverlayClassName;i(t).delegate(h,"click",r.onClick);i(t).delegate(c,"click",r.onClose);i(t).delegate(s,"click",r.onClose);i(t).delegate("*","keydown",function(n){(27===n.keyCode||27===n.which)&&(1===i(l).length&&r.cancelXHR(),r.onClose(n))});i(t).delegate(a+".show-as-infographic","mouseenter",function(o,s){var c=i("."+r.settings.className),l=i(n).width(),h=new Image;return 768>=l?void(n.location=this.src):(h.className=r.settings.infographicClassName,h.onload=function(){r.settings.$appendTo.append(this);i(u).wrap('<div class="'+r.settings.infographicContainerClassName+'"><\/div>').wrap('<div class="'+r.settings.infographicHolderClassName+'"><\/div>').wrap('<div class="inner-wrapper">').attr("title",s.title);i(u).parent().append('<div class="momo-infographic-close"><\/div>');i(f).append('<div class="'+r.settings.infographicOverlayClassName+'"><\/div>');i(e).css({left:"50%",top:"50%",width:this.width+"px",height:this.height+"px",marginLeft:-this.width/2+"px",marginTop:-this.height/2+"px"});i(t).undelegate("."+r.settings.infographicClassName,"click");void 0!==s.downloadUrl&&s.downloadUrl.length>0&&(i(u).addClass("momo-downloadable"),i(t).delegate("."+r.settings.infographicClassName,"click",function(){var i=t.createElement("a");i.href=s.downloadUrl;void 0!==s.wtAc&&s.wtAc.length>0&&dcsMultiTrack("DCS.dcssip",i.hostname,"DCS.dcsuri",i.pathname,"WT.ac",s.wtAc);n.location=s.downloadUrl}));i(u+".momo-downloadable").momoTooltip()},h.src=this.src,void c.momoRemove())});i(t).delegate(v+", .momo-infographic-close","click",function(){r.close()});o=function(t){var o=i(n).width(),s=i(n).height(),l=t.clientX/o,a=t.clientY/s,r=i(e),u=r.width(),f=r.height(),h=-a*f,c=-l*u;o>=u&&(c=-u/2);s>=f&&(h=-f/2);r.css({marginTop:h+"px",marginLeft:c+"px"})};i(t).delegate(f,"mousemove",o);Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){if(void 0===this||null===this)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,1/0===Math.abs(t)&&(t=0),0>t&&(t+=i,0>t&&(t=0));i>t;t++)if(this[t]===n)return t;return-1})}(window,document,jQuery),function(n){n.fn.lazyMomo=function(t,i){var r=n(window),f=t||0,s=i!==!1,h=window.devicePixelRatio>1,c=h?"data-src-retina":"data-src",u=this,e,o=function(){var t=u.filter(function(){var t=n(this);if(!t.is(":hidden")){var i=r.scrollTop(),e=i+r.height(),u=t.offset().top,o=u+t.height();return o>=i-f&&u<=e+f}});e=t.trigger("visible");u=u.not(e)};s&&this.each(function(){var t=n(this),i=n('<div class="lazy-momo-img-overlay"><\/div>'),r=t.width(),u=t.height();i.css({top:t.position().top,left:t.position().left,width:r,height:u});t.after(i)});this.one("visible",function(){var t=this.getAttribute(c)||this.getAttribute("data-src");t&&(this.onload=function(){var t=n(this),i=function(){n(window).width()<=640&&t.closest(".image-section").length>0?t.width("100%"):t.width("auto");t.height("auto");t.nextAll(".lazy-momo-img-overlay").first().remove()};n("html").hasClass("ie8")?(t.css("visibility","hidden"),setTimeout(function(){i();t.css("visibility","visible")},0)):i()},this.setAttribute("src",t))});return r.bind("scroll.lazyMomo resize.lazyMomo lookup.lazyMomo",o),o(),this};n.fn.forceRatio=function(){var i=n(window),r=this,t=function(){r.each(function(){var i=parseInt(this.getAttribute("data-original-width")),r=parseInt(this.getAttribute("data-original-height")),u,t;!isNaN(i)&&i>0&&!isNaN(r)&&r>0&&(u=i/r,t=n(this).width(),t==1&&(n(this).css("width","100%"),t=n(this).width()),t>1&&n(this).height(t/u))})};return t(),i.bind("resize.forceRatio",t),this}}(window.jQuery),Date.now||(Date.now=function(){return(new Date).getTime()}),Modernizr.localstorage){var SurveyStore={keys:{siteViews:"siteviews",declinedCounter:"declined",surveyed:"surveyed",lastAction:"lastaction"},prefix:function(n){return SurveyLauncher.identifier+n},set:function(n,t){n=this.prefix(n);localStorage.setItem(n,t)},setToday:function(n){n=this.prefix(n);localStorage.setItem(n,Date.now()/864e5|0)},get:function(n){return n=this.prefix(n),localStorage.getItem(n)},clean:function(){for(var n in this.keys)localStorage.removeItem(this.prefix(this.keys[n]))}},SurveyWT={onLaunch:function(){dcsMultiTrack("WT.tool_name","HSBC Survey","WT.HSBCSurveyLaunch","Yes","WT.cta","Survey|ShowPopup","WT.es",window.location.href,"WT.dl",99)},onYes:function(){dcsMultiTrack("WT.tool_name","HSBC Survey","WT.HSBCSurveyLaunch","Yes","WT.cta","Survey|Join","WT.es",window.location.href,"WT.dl",24)},onNo:function(){dcsMultiTrack("WT.tool_name","HSBC Survey","WT.HSBCSurveyLaunch","Yes","WT.cta","Survey|Decline","WT.es",window.location.href,"WT.dl",99)}},SurveyLauncher={identifier:"HSBCSurveyLauncher_",siteViews:0,declinedCounter:0,settings:{displayMode:"modal",minSiteViews:5,wait:500,ratio:.5,keepAsking:5,askAgainWhenDeclined:3,askAgain:30,modalHeading:"",modalContent:"",feedbackContent:"",surveyUrl:"",yesText:"Yes",noText:"No",yesActionTriggers:"#survey_yes",noActionTriggers:"#survey_no, #SurveyLauncher a.closeButton, #SurveyLauncher .pageClose",disclaimer:""},launchers:{feedback:function(){SurveyWT.onLaunch();var n='<div class="survey-feedback" id="survey-feedback"><div class="inner"><p>'+this.settings.feedbackContent+'<\/p><a id="survey_yes" href="#go-to-site" class="page-link text-pure-black">'+this.settings.yesText+'<span class="arrow"><\/span><\/a><a id="survey_no" href="" class="page-link text-pure-black">'+this.settings.noText+'<span class="arrow"><\/span><\/a><\/div><\/div>';$(n).appendTo("body")},modal:function(){var n,t,i;SurveyWT.onLaunch();n=new MessageBox;t="<table id=\"SurveyLauncher\" cellpadding='0' cellspacing='0' width='100%'><tr><td class='msgBoxTopLeft'><\/td><td class='msgBoxTopMiddle' width='100%'><\/td><td class='msgBoxTopRight'><a href='/' id='closeButton' class='closeButton'>close dialog<\/a><\/td><\/tr><tr><td class='imgWhite'><\/td><td class='msgBoxMiddleMiddle'><!--content--><\/td><td class='imgWhite'><\/td><\/tr><tr><td class='msgBoxBottomLeft'><\/td><td class='msgBoxBottomMiddle'><\/td><td class='msgBoxBottomRight'><\/td><\/tr><\/table>";n.setEnableTemplates(!0);n.setOverlayClass("survey-overlay");n.setTemplate(t);n.setContentClass("survey-launcher");$(document).width()>640?(n.setTop("200px"),n.setLeft("auto")):(n.setTop(0),n.setLeft(0));n.setOverlayInlineCss("");n.setContentInlineCss("");i='<div><div class="external-link-content"><h2 class="likeH1">'+this.settings.modalHeading+'<\/h2><p class="intro">'+this.settings.modalContent+'<\/p><br /><a href="#go-to-site" id="survey_yes" class="btn-default go-to-site no-popup btn" title="Go to site" role="button" tabindex="2"><div class="button_left"><\/div><div class="button_middle"><span class="link">'+this.settings.yesText+'<\/span><\/div><div class="button_right"><\/div><\/a><br /><a href="" class="page-link text-pure-black pageClose" id="survey_no">'+this.settings.noText+'<span class="arrow"><\/span><\/a><\/div>'+this.settings.disclaimer+"<\/div>";n.setContent(i);n.setCallback(function(){$(SurveyLauncher.settings.noActionTriggers).bind("click",function(t){t.preventDefault();n.hide()})});n.init();n.show()}},actions:{yes:function(){SurveyWT.onYes();SurveyStore.set(SurveyStore.keys.declinedCounter,0);SurveyStore.set(SurveyStore.keys.siteViews,0);SurveyStore.setToday(SurveyStore.keys.surveyed);SurveyStore.set(SurveyStore.keys.lastAction,"yes");window.location.href=this.settings.surveyUrl},no:function(){SurveyWT.onNo();SurveyStore.set(SurveyStore.keys.declinedCounter,SurveyLauncher.declinedCounter+1);SurveyStore.set(SurveyStore.keys.siteViews,0);SurveyStore.setToday(SurveyStore.keys.surveyed);SurveyStore.set(SurveyStore.keys.lastAction,"no");$("#survey-feedback").length>0&&$("#survey-feedback").remove()}},bindEvents:function(){$(document).delegate(this.settings.yesActionTriggers,"click",function(n){n.preventDefault();SurveyLauncher.actions.yes.apply(SurveyLauncher)});$(document).delegate(this.settings.noActionTriggers,"click",function(n){n.preventDefault();SurveyLauncher.actions.no.apply(SurveyLauncher)})}};SurveyLauncher.launch=function(){SurveyLauncher.settings.displayMode==="feedback"?SurveyLauncher.launchers.feedback.apply(SurveyLauncher):SurveyLauncher.settings.displayMode==="modal"&&SurveyLauncher.launchers.modal.apply(SurveyLauncher)};SurveyLauncher.init=function(){var t=SurveyStore.get(SurveyStore.keys.lastAction)||"first time",r=SurveyStore.get(SurveyStore.keys.surveyed)|0,u=SurveyStore.get(SurveyStore.keys.siteViews),f=SurveyStore.get(SurveyStore.keys.declinedCounter),i,n;u!==null?(this.siteViews=parseInt(u)+1,SurveyStore.set(SurveyStore.keys.siteViews,this.siteViews)):SurveyStore.set(SurveyStore.keys.siteViews,1);f!==null&&(this.declinedCounter=parseInt(f));i=Date.now()/864e5|0;n=this.settings.minSiteViews<=this.siteViews&&Math.random()<=this.settings.ratio;n=t==="no"&&this.settings.keepAsking>=SurveyLauncher.declinedCounter?n&&this.settings.askAgainWhenDeclined+r<=i:t==="yes"?n&&this.settings.askAgain+r<=i:t==="first time"?!0&&n:!1;n&&(this.bindEvents(),setTimeout(this.launch,this.settings.wait))};surveyLauncherOptionsXHR=$.getJSON("/hsbcdotcom/webservices/UtilityWebServices/SurveyLauncher.asmx/Options");surveyLauncherOptionsXHR.done(function(n){n&&n.hasOwnProperty("SurveyLauncherOptions")&&n.SurveyLauncherOptions.turnOn&&(SurveyLauncher.settings=$.extend(SurveyLauncher.settings,n.SurveyLauncherOptions),SurveyLauncher.init())})}