(function(C,A,E){var B=C.identity,D=C.idProperties;B=B||{};B.app=function(){var y={},J={},L={},AD={},s={},c,AC,X="",n,P,I,AK={},AE,d,O=[],AH="closed";var AA="id-panel-working",z="id-panel-animating",u="working-spinner",f="c",v="panel-noHeader",h="hd",x="ft",e="bbcid_username",Z="bbcid_password",H="bbcid_remember_me",t="id-status",w=["#",t].join(""),AI="#blq-pre-mast",b="#idNotifyClose",T=".panel-identity",g=[T," .",f].join(""),o=[T," .working-spinner"].join(""),j=[T," a.id-back"].join(""),q=[T," a.id-signin"].join(""),K=[q," span"].join(""),R=[T," a.id-register"].join(""),p=[R," span"].join(""),W=[T," a.id-help"].join(""),AG=[T," .id-explain-dob a"].join(""),S=[T," a.id-terms"].join(""),AJ=[S," span"].join(""),Q=[T," #id-signin-form"].join(""),AF=[Q," input#",e].join(""),AB=[Q," input#",Z].join(""),G=[Q," input#",H].join(""),F=[T," #id-actions .negative"].join(""),m=[T," #id-actions .positive"].join(""),Y=[w," a.idSignin"].join("");var k={"en-GB":{dir:"ltr"},"cy-GB":{dir:"ltr"},"ga-IE":{dir:"ltr"},"gv-GB":{dir:"ltr"},"ru-RU":{dir:"ltr"},"fa-IR":{dir:"rtl"},"ar-SA":{dir:"rtl"}};var U=["/users/widget/status/?ptrt=",C.location].join("");var N="en-GB";function l(r){var AM=r.attachedTo.href.split("?"),AL="";if(AM.length==2){AL="?"+AM[1]}return AL}var V=function(){this.views={};this.currentView=""};V.prototype.getView=function(AL,r){r=r||N;this.views[r]=this.views[r]||[];if(!(AL in this.views[r])&&L[AL]){this.views[r][AL]=new L[AL](AD);this.views[r][AL].setLocale(r);d.setLocale(r);this.loadErrorCodes(r)}return this.views[r][AL]};V.prototype.emptyViewCache=function(){var AM,AL,r;for(AM in this.views){for(AL in this.views[AM]){r=this.views[AM][AL];r.emptyCache()}}};V.prototype.getLocaleFromUrl=function(r){return B.util.getArgsFromUrl(r)["loc"]||false};V.prototype.getLocaleFromFormElement=function(AL){var AM,AN;AL=n(AL);if(AL.is("form")){AN=AL[0].action}else{try{AN=AL.ancestors().filter(function(){return n(this).is("form")?true:false})[0].action}catch(r){}}return AN?this.getLocaleFromUrl(AN):E};V.prototype.isDate16YearsAgo=function(r,AN,AM){if(r>0&&AN>0&&AM>0){var AL=new Date();if((AL.getFullYear()-AM)>16){return false}else{if((AL.getFullYear()-AM)<16){return true}else{if((AL.getMonth()+1)>AN){return false}else{if((AL.getMonth()+1)<AN){return true}else{if(AL.getDate()>=r){return false}else{if(AL.getDate()<r){return true}}}}}}}else{return false}};V.prototype.scrollToEventLinkTarget=function(AM){if(typeof AM!="undefined"){var AN=n(AM.attachedTo);var AL=AN.attr("href");if(AN.length&&AL){target=AL.substring(AL.indexOf("#"));if(AL.indexOf("#")!=-1&&target.length){var r=B.util.getScrollPosition("y");C.location=target;C.scrollTo(0,r)}}}};V.prototype.decodeSecureFormCookie=function(AM,AP){if(!AM.match(/^[ulsgmvhfe]$/i)&&!AM.match(/^mm$/i)&&!AM.match(/^[abc](\|[a-z]{2}([a-z]{2})?)+$/i)){return false}var r={};AM=AM.split("|");if(AM[0]=="u"){AD.handleUpgrade()}else{if(AM[0]=="l"){AD.handleAccountLocked()}else{if(AM[0]=="s"){AD.handleSessionExpired(AD.currentView.getLocale())}else{if(AM[0]=="g"){AD.handleAgeMismatch()}else{if(AM[0]=="m"){AD.handleMoreDetails()}else{if(AM[0]=="v"){AD.handleValidation()}else{if(AM[0]=="h"){AD.handleHouseRules()}else{if(AM[0]=="f"){AD.handleSigninFail()}else{if(AM[0]=="e"){AD.handleServiceError(AD.currentView.getLocale())}else{if(AM[0]=="mm"){AD.handleMaintenanceModeError()}else{if(AM[0]=="a"){r._error=true;r._valid=false}else{if(AM[0]=="b"){r._error=false;r._valid=false}else{if(AM[0]=="c"){r._error=false;r._valid=true}}}}}}}}}}}}}for(i=1;i<AM.length;i++){var AO=AM[i].charAt(0);var AL=AM[i].charAt(1);var AN=(AM[i].length>2)?O[this.currentView.getLocale()][AM[i].substr(2,2)]:"";AO=AP[AO];r[AO]={};if(AL=="a"){r[AO]._error=true;r[AO]._valid=false}else{if(AL=="b"){r[AO]._error=false;r[AO]._valid=false}else{if(AL=="c"){r[AO]._error=false;r[AO]._valid=true}}}r[AO].container=["#bbcid_",AO,"_container"].join("");r[AO].message=AN;r[AO].messageContainer=["#bbcid_",AO,"_container .hint"].join("")}return r};V.prototype.handleUpgrade=function(AL){var r=[D.secureServer,"/users/upgrade"].join("");C.location=r};V.prototype.handleSigninFail=function(AL){var r=[D.secureServer,"/users/signin/fail"].join("");C.location=r};V.prototype.handleServiceError=function(r){var AL=this.getView("ServiceErrorView",r);AL.setContentParameters("?loc="+r);AL.nonJSEquiv=["/users/error/serviceerror?ptrt=",C.location,"&loc=",r].join("");AL.show()};V.prototype.handleMaintenanceModeError=function(r){var AL=this.getView("MaintenanceModeView",r);AL.setContentParameters("?loc="+r);AL.nonJSEquiv=["/users/error/maintenancemode?ptrt=",C.location,"&loc=",r].join("");AL.show()};V.prototype.handleSignin=function(AL){if(AL){AL.preventDefault()}var r=this.getLocaleFromUrl(AL.attachedTo);var AM=this.getView("SigninView",r);AM.nonJSEquiv=[D.secureServer,"/users/signin?ptrt=",C.location].join("");AM.show()};V.prototype.handleAccountLocked=function(AL){var r=[D.secureServer,"/users/signin/locked"].join("");C.location=r};V.prototype.handleSessionExpired=function(r){var AL=this.getView("SessionExpiredView",r);AL.setContentParameters("?loc="+r);AL.nonJSEquiv=["/users/error/sessionexpired?ptrt=",C.location,"&loc=",r].join("");AL.show()};V.prototype.handleAgeMismatch=function(AL){var r=[D.secureServer,"/users/signin/age"].join("");C.location=r};V.prototype.handleMoreDetails=function(AL){var r=[D.secureServer,"/users/signin/more"].join("");C.location=r};V.prototype.handleValidation=function(AL){var r=[D.secureServer,"/users/signin/validate"].join("");C.location=r};V.prototype.handleHouseRules=function(AL){var r=[D.secureServer,"/users/signin/houserules"].join("");C.location=r};V.prototype.handleSigninFormSubmit=function(AM){var AL=this,r=AL.getLocaleFromFormElement(AM.attachedTo);var AN=this.getView("SigninView",r);if(AM){AM.preventDefault()}AN.validation.validate("submit",{onSuccess:function(){var AO=new B.forms.SecureForm(AN.config.secureFormSettings.form,{secureUrl:AN.config.secureFormSettings.secureUrl,handleResult:function(AP){AN.hideFormSpinner();if(AP._valid){var AQ=new X.events.Event();X.events.fire(B,"signin",AQ)}else{AL.getView("SigninView",r).validation.processValidationResult({validationResult:AP,event:""});AD.handleErrorFailures()}}});AN.showFormSpinner();AO.submit(function(AQ,AP){return AL.decodeSecureFormCookie(AQ,AP)})},onFailure:function(){AD.handleErrorFailures()}})};V.prototype.handleSigninFormUsernameBlur=function(AL){var r=this.getLocaleFromFormElement(AL.attachedTo);this.getView("SigninView",r).validation.validate("blur",{id:e,onFailure:AD.handleErrorFailures,onSuccess:function(){AD.handleErrorSuccess(e)}})};V.prototype.handleSigninFormPasswordBlur=function(AL){var r=this.getLocaleFromFormElement(AL.attachedTo);this.getView("SigninView",r).validation.validate("blur",{id:Z,onFailure:AD.handleErrorFailures,onSuccess:function(){AD.handleErrorSuccess(Z)}})};V.prototype.handleOpenHelpDrawer=function(AL){if(AL){AL.preventDefault()}var r=this;X.net.get("/users/help.js",{onLoad:function(AM){c.getDrawer().update(["<div>",AM.text(),"</div>"].join("")).open({onComplete:function(){r.scrollToEventLinkTarget(AL)}})}})};V.prototype.handleOpenTermsDrawer=function(AL){var r=this;if(AL){AL.preventDefault()}X.net.get("/users/register/terms.js",{onLoad:function(AM){c.getDrawer().update(["<div>",AM.text(),"</div>"].join("")).open({onComplete:function(){r.scrollToEventLinkTarget(AL)}})}})};V.prototype.handleCloseDrawer=function(r){if(r){r.preventDefault()}c.getDrawer().close()};V.prototype.handleShowDrawer=function(r){if(r){r.preventDefault()}c.getDrawer().show()};V.prototype.handleHideDrawer=function(r){if(r){r.preventDefault()}c.getDrawer().hide()};V.prototype.handleErrorFailures=function(){n("form.id-form .error").filter(function(){return n(this).is("input, select, textarea")?false:true}).each(function(AM){var AL=n(this),AN=AL.get(".hint"),r=AL.get("input, select").filter(function(AO){return n(this).attr("type")!="hidden"});r.each(function(){d.hide("hint",n(this).attr("id"))});d.error(AN.text(),r).show()})};V.prototype.handleErrorSuccess=function(r){d.hide("error",r)};V.prototype.removeAllErrors=function(){d.hideAll();d.flushRegister()};V.prototype.loadErrorCodes=function(r){if(!(r in O)){X.net.get("/users/configuration/error_codes.json?loc="+r,{onLoad:function(AM){var AL=AM.json();if(AL.codes){O[r]=AL.codes}},onError:function(AL){}})}};L.View=function(r){this.controller=r;this.loaded=false;this.contentUrlParams="";this.locale=N;d.hideAll()};L.View.prototype.setContentParametersFromEvent=function(r){this.setContentParameters(l(r));return this};L.View.prototype.setContentParameters=function(r){this.contentUrlParams=r;return this};L.View.prototype.setLocale=function(r){this.locale=r;return this};L.View.prototype.getLocale=function(){return this.locale};L.View.prototype.applyLocale=function(){var AL=this.locale,r=k[AL]["dir"];c.content.parent().addClass("ID-"+AL).addClass("ID-"+r).attr("dir",r).attr("lang",AL);return this};L.View.prototype.show=function(AM){var AL=this;if(AM){if(AM.onSuccess&&typeof AM.onSuccess=="function"){this.onSuccess=AM.onSuccess}if(AM.onFailure&&typeof AM.onFailure=="function"){this.onFailure=AM.onFailure}}this.controller.removeAllErrors();if(AH=="closed"){AC=(typeof AC=="undefined")?(new X.widgets.Mask()):AC;var r=n(w)}else{if(AD.currentView&&AD.currentView.validation){AD.currentView.validation.stopAll()}}if(typeof (c)=="undefined"){c=new idPanel(X.dom.create("<p></p>"),{closeOnMaskClick:false,width:"355px",theme:"identity",mask:AC});P(c,"afterHide",function(AO){AL.controller.removeAllErrors()});if(C.location.pathname.match(/^\/cbbc($|\/)/)||n(".blq-cbbc").length){c.container.addClass("bbcid-cbbc-panel")}}this.applyLocale();var AN=function(){var AO=c.container.get(g).height();c.hideContent();if(AH!="open"){c.container.get(T).css("width","100px").parent().css("width","100px").get([".",f].join("")).css("height","65px")}else{c.container.get(g).css("height",AO)}AL.showSpinner();c.container.addClass(z);if(!AL.loaded||AL.config.useViewCache===false){if(!AL.loaded){AH="loading";X.net.get(AL.configUrl+AL.contentUrlParams,{onLoad:function(AP){AL.config=AP.json();AL.show_pt2()},onError:function(){},timeout:6000})}else{AL.show_pt2()}}else{AL.show_pt3()}};if(c.hasDrawer()){c.getDrawer().close({onComplete:AN})}else{AN()}};L.View.prototype.show_pt2=function(){if(!this.loaded||this.config.useViewCache===false){AH="loading";var r=this,AL=function(AM){this.config.content=AM.text();this.config.saveState="";this.show_pt3()};X.net.get([this.config.contentUrl,this.contentUrlParams].join(""),{onLoad:function(AM){AL.call(r,AM)},onError:function(AM){AD.decodeSecureFormCookie(B.util.getCookie("IDENTITY-ERRORS").split("*")[2]);if(r.onFailure){r.onFailure()}}})}else{this.show_pt3()}};L.View.prototype.show_pt3=function(){c.showContent();if(!this.loaded||this.config.useViewCache===false){this.loaded=true}if(this.controller.currentView){this.controller.currentView.removeListeners()}var r;if(this.config.saveState!==""){r=X.dom.create(this.config.saveState);this.config.saveState=""}else{r=X.dom.create(this.config.content)}var AM=r.get("label");AM.each(function(){if(n(this).get("span.hint").length===0){n(this).append('<span class="hint"><span class="t"></span><span class="b"></span></span>')}});var AL=this;c.showWith(r,{width:this.config.width,callback:function(){c.container.removeClass(z);AL.hideSpinner();AL.show_pt4()}})};L.View.prototype.show_pt4=function(){if(!this.validation&&this.config.validation){this.validation=new B.forms.Validator({onFailure:AD.handleErrorFailures});this.validation.parseChecksObject(this.config.validation)}c.show();this.eventListenerIds=[];this.addEvents();this.controller.currentView=this;c.newpanel=false;B.app.fixLayout();c.setPosition();if(X.env.ie&&X.env.ie<=7){c.content.get("div.c").css("zoom",1)}AH="open";var r=this;setTimeout(function(){r.sendFocus()},50);if(this.onSuccess){this.onSuccess()}X.events.fire(B,"panelLoaded")};L.View.prototype.hide=function(AL){if(AL){AL.preventDefault()}if(AH=="open"){AH="close_anim";c.container.addClass(z);c.newpanel=true;if(AD.currentView.validation){AD.currentView.validation.stopAll()}AD.handleHideDrawer();AD.removeAllErrors();this.removeListeners();var r=this;c.hide();AH="closed"}};L.View.prototype.sendFocus=function(){var r=n(this.config.focusId);if(r.length){r[0].focus()}};L.View.prototype.removeListeners=function(){for(eid=0;eid<this.eventListenerIds.length;eid++){X.events.removeListener(this.eventListenerIds[eid])}};L.View.prototype.saveState=function(){c.body.get("input, select, textarea").each(function(){var AN=X.dom.get(this);var AO=AN.attr("type");if(AO=="text"||AO=="password"){AN.attr("value",AN.val())}else{if(AO=="checkbox"||AO=="radio"){if(typeof (AN.val())=="string"){AN.attr("checked","checked")}else{AN.removeAttr("checked")}}else{if(AN.is("select")){AN.get("option").each(function(){var AP=n(this);if(AN.val()==AP.attr("value")){AN.attr("selected","selected")}else{AN.removeAttr("selected")}})}else{if(AN.is("textarea")){AN.html(AN.val())}}}}});var AL=c.header.html();var AM=c.body.html();var r=c.footer.html();if(X.env.ie){AL=AL.replace(/__[^"\s]+"[^"\s]+"/g,"");AM=AM.replace(/__[^"\s]+"[^"\s]+"/g,"");r=r.replace(/__[^"\s]+"[^"\s]+"/g,"")}this.config.saveState=[AL,AM,r].join("")};L.View.prototype.deleteState=function(){this.config.saveState=""};L.View.prototype.emptyCache=function(){this.deleteState();this.config.content="";this.loaded=false};L.View.prototype.showSpinner=function(){c.container.get(g).addClass(AA)};L.View.prototype.hideSpinner=function(){c.container.get(g).removeClass(AA)};L.View.prototype.showFormSpinner=function(){var r=n(m);var AL=r.parent().append(['<span class="',u,'">Working...</span>'].join("")).get([".",u].join(""));AL.css("top",[(((r.offset().top-r.parent().offset().top)+(r.height()/2))-(AL.height()/2)),"px"].join("")).css("left",[((r.offset().left-r.parent().offset().left-AL.width())-5),"px"].join(""))};L.View.prototype.hideFormSpinner=function(){n(o).remove();return this};L.SigninView=function(){arguments.callee.base.apply(this,arguments);this.configUrl="/users/configuration/signin.js"};L.SigninView.prototype.addEvents=function(){this.eventListenerIds[this.eventListenerIds.length]=P(n(p),"mouseover",function(AM){n(this).addClass("hovered")});this.eventListenerIds[this.eventListenerIds.length]=P(n(p),"mouseout",function(AM){n(this).removeClass("hovered")});this.eventListenerIds[this.eventListenerIds.length]=P(n(F),"click",function(AM){AM.preventDefault();this.hide();X.events.fire(B,"signinCancel")},this);this.eventListenerIds[this.eventListenerIds.length]=P(n(W),"click",AD.handleOpenHelpDrawer,AD);this.eventListenerIds[this.eventListenerIds.length]=P(n(Q),"submit",AD.handleSigninFormSubmit,AD);this.eventListenerIds[this.eventListenerIds.length]=P(n(AF),"blur",AD.handleSigninFormUsernameBlur,AD);this.eventListenerIds[this.eventListenerIds.length]=P(n(AB),"blur",AD.handleSigninFormPasswordBlur,AD);var r=[AF,AB,G];for(var AL=0;AL<r.length;AL++){d.setPanel(r[AL],this.eventListenerIds)}};L.SessionExpiredView=function(){arguments.callee.base.apply(this,arguments);this.configUrl="/users/configuration/sessionexpired.js"};L.SessionExpiredView.prototype.addEvents=function(){this.eventListenerIds[this.eventListenerIds.length]=P(n(m),"click",this.hide,this)};L.ServiceErrorView=function(){arguments.callee.base.apply(this,arguments);this.configUrl="/users/configuration/serviceerror.js"};L.ServiceErrorView.prototype.addEvents=function(){this.eventListenerIds[this.eventListenerIds.length]=P(n(m),"click",this.hide,this)};L.MaintenanceModeView=function(){arguments.callee.base.apply(this,arguments);this.configUrl="/users/configuration/maintenancemode.js"};L.MaintenanceModeView.prototype.addEvents=function(){this.eventListenerIds[this.eventListenerIds.length]=P(n(m),"click",this.hide,this)};var M=function(){this.panels={};this.panelAnims={};this.locale="en-GB";this.template='<div class="panel-id-hint"><div class="{type}"><div class="infoPanel-pointerT"></div><div class="infoPanel-pointerL"></div><div class="infoPanel-pointerR"></div><div class="panel-hd"></div><div class="panel-bd"></div><div class="panel-ft"></div><div class="infoPanel-pointerB"></div></div></div>';this.dummyTemplate='<div style="position:absolute;top:0px;left:0px;visibility:hidden" id="id-height-calculate" class="panel-id-hint glowNoMask blq-rst"><div class="light"><div class="infoPanel-pointerT"></div><div class="infoPanel-pointerL"></div><div class="infoPanel-pointerR"></div><div class="panel-hd"></div><div class="panel-bd"><p></p></div><div class="panel-ft"></div><div class="infoPanel-pointerB"></div></div></div>'};M.prototype.hint=function(AL,r){return this.create(AL,r,"hint")};M.prototype.error=function(AL,r){return this.create(AL,r,"error")};M.prototype.setPanel=function(AP,AM){var AN=n(AP),AQ=AN.parent().get(".hint"),AL,AO;if(!AQ.length||AQ.text()==""){var r=AN.parent().parent().get("legend .hint");if(r.length&&r.text()!=""){AO=r.text()}else{AO=""}}else{AO=AQ.text()}if(AO){AL=d.hint(AO,AN);AM[AM.length]=P(AN,"focus",function(){if(!AN.parent().parent().hasClass("error")&&!(AN.parent().parent().is("fieldset")&&AN.parent().parent().parent().hasClass("error"))){d.updateOffset(AL,AN);AL.setPosition();if(this.panelAnims.hint&&this.panelAnims.hint[AN.attr("id")]){try{this.panelAnims.hint[AN.attr("id")].stop();this.panelAnims.hint[AN.attr("id")].goTo(0)}catch(AR){}}AL.show()}},this);AM[AM.length]=P(AN,"blur",function(){d.hide("hint",AN.attr("id"))},this)}};M.prototype.create=function(AO,AM,AN){AM=n(AM);this.panels[AN]=this.panels[AN]||{};if(this.panels[AN][AM.attr("id")]&&this.panels[AN][AM.attr("id")].body.get("p").text()==AO){return this.panels[AN][AM.attr("id")]}else{var AQ=AM.attr("id");var AL=AM.parent().parent();if(AL[0].nodeName.toLowerCase()=="fieldset"){AM=AL.parent()}else{if(AL.hasClass("checkbox")){AM=AL}}if(k[this.locale]["dir"]=="rtl"){var r=AM.ancestors().filter(function(){return n(this).attr("dir")=="rtl"});r.each(function(){n(this).attr("dir","ltr")});var AP=X.dom.create('<div class="form-context"></div>').width(AM.width()+38+2).height(AM.height()+12+2).css("display","block").css("position","absolute").css("top",AM.offset()["top"]).css("left",AM.offset()["left"]);n("body").append(AP);r.each(function(){n(this).attr("dir","rtl")});AM=AP}if(this.panels[AN][AQ]){this.panels[AN][AQ].hide();this.panels[AN][AQ].container.remove()}this.panels[AN][AQ]=new idInfoPanel(X.dom.create(["<p>",AO,"</p>"].join("")),{context:AM,returnTo:"",pointerPosition:(k[this.locale]["dir"]=="rtl")?"r":"l",focusOnShow:false,modal:false,template:X.lang.interpolate(this.template,{type:AN}),pointerRegisters:{l:(k[this.locale]["dir"]=="rtl")?null:{x:0,y:(this.calculateHeight(AO)/2)},r:(k[this.locale]["dir"]=="rtl")?{x:270,y:(this.calculateHeight(AO)/2)}:null}});this.localisePanel(this.panels[AN][AQ]);this.panels[AN][AQ].content.addClass("blq-rst");this.updateOffset(this.panels[AN][AQ],AM);return this.panels[AN][AQ]}};M.prototype.updateOffset=function(AL,AO){var r,AP=11,AN,AM=k[this.locale]["dir"];AN=AO.parent().parent();if(AN[0].nodeName.toLowerCase()=="fieldset"){AP=AO.offset().top-AN.parent().offset().top;AO=AN.parent();if(AM=="ltr"){r=AO[0].offsetWidth-2}else{r=-7}}else{if(AN.hasClass("checkbox")){AP=AO.offset().top-AN.offset().top;AO=AN;if(AM=="ltr"){r=AO[0].offsetWidth-7}else{r=-2}}else{if(AM=="ltr"){r=AO[0].offsetWidth+4}else{r=-13}}}AL.setOffsetInContext({x:r,y:AP})};M.prototype.calculateHeight=function(r){var AL=n("#id-height-calculate");if(!AL[0]){AL=X.dom.create(this.dummyTemplate).appendTo(n("body"))}AL.get(".panel-bd p").text(r);return AL.height()};M.prototype.setPosition=function(){for(type in this.panels){for(hint in this.panels[type]){this.panels[type][hint].setPosition()}}};M.prototype.setLocale=function(r){this.locale=r;for(type in this.panels){for(hint in this.panels[type]){this.localisePanel(this.panels[type][hint]);this.panels[type][hint].setPosition()}}};M.prototype.localisePanel=function(r){var AL=k[this.locale]["dir"];r.content.parent().addClass("ID-"+this.locale).addClass("ID-"+AL).addClass("blq-"+AL);r.content.get(".panel-bd").attr("lang",this.locale).attr("dir",AL)};M.prototype.hide=function(AM,AL){if(this.panels[AM]&&this.panels[AM][AL]){var r=this.panels[AM][AL];this.panelAnims[AM]=this.panelAnims[AM]||{};this.panelAnims[AM][AL]=X.anim.css(r.container,0.3,{opacity:{to:0}});X.events.addListener(this.panelAnims[AM][AL],"complete",function(){r.hide();r.container.css("opacity",1)});this.panelAnims[AM][AL].start();return true}else{return false}};M.prototype.hideAll=function(){for(type in this.panels){for(hint in this.panels[type]){this.hide(type,hint)}}};M.prototype.flushRegister=function(){this.panels={}};d=new M();y.parseStatusLinks=function(){if(AK.signin){I(AK.signin)}var r=n(Y);if(r.length){AK.signin=P(r,"click",function(AL){AL.preventDefault();if(AH=="closed"&&!B.status.hasChanged()){AD.handleSignin(AL)}},AD)}};y.extendViews=function(){X.lang.extend(L.SigninView,L.View,L.SigninView.prototype);X.lang.extend(L.SessionExpiredView,L.View,L.SessionExpiredView.prototype);X.lang.extend(L.ServiceErrorView,L.View,L.ServiceErrorView.prototype);X.lang.extend(L.MaintenanceModeView,L.View,L.MaintenanceModeView.prototype)};y.getPanel=function(){return c};y.showPanel=function(r,AM,AL){onSuccess=(AL&&AL.onSuccess)?AL.onSuccess:null;onFailure=(AL&&AL.onFailure)?AL.onFailure:null;switch(r){case"signin":if(!AM){AD.getView("SigninView",false).show({onSuccess:onSuccess,onFailure:onFailure})}else{AD.getView("SigninView",AD.getLocaleFromUrl(AM.attachedTo.href)).setContentParametersFromEvent(AM).show({onSuccess:onSuccess,onFailure:onFailure})}break;default:break}};y.fixLayout=function(){if(X.env.webkit){n("#bbcid_date_of_birth-container legend").css("margin-left","0").css("margin-right","0")}};y.init=function(r,AL){X=r;n=X.dom.get;P=X.events.addListener;I=X.events.removeListener;this.extendViews();AD=new V();P(B,"signin",function(AM){AD.currentView.hideFormSpinner().hide()});X.events.addKeyListener("ESC","press",function(){if(c.isVisible()){AD.currentView.hide()}});P(B,"panelLoaded",function(AM){})};return y}();if(B&&B.resourceLoaded){B.resourceLoaded("id-app.js")}var B=(typeof B=="undefined")?{}:B;B.forms=function(){var F={},M,K,G,L,J=[],N=/^[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*@[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*|(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]*(?:(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]*)*<[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:@[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*(?:,[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*@[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*)*:[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)?(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*@[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*>)$/;F.blackListRegex=function(Q){Q=Q||"";var P="!\"#\\$%&'\\(\\)\\*\\+,\\./:;<=>?@\\[\\]\\^`|\\{\\}~¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¹º»¼½¾¿×÷;–—‘’‚‛“”„†‡…‹›€";return new RegExp("^[^"+P+Q+"]*$")};F.Validator=function(){this.checks=[];this.validationGroups=[]};F.Validator.prototype.addCheck=function(P){this.checks[this.checks.length]=P};F.Validator.prototype.addValidationGroup=function(Q,P){this.validationGroups[this.validationGroups.length]=new B.forms.ValidationGroup(Q,P)};F.Validator.prototype.parseChecksObject=function(P){var k,j,h,S,U,b,g,R;for(h in P){S=P[h];for(k in S.tests){j=S.tests[k];if(j.type){U=j.type}else{continue}if(j.test||U=="notempty"||U=="email"||U=="numeric"){g=j.test?j.test:""}else{continue}if(j.events){if(typeof j.events=="object"){R=j.events}else{if(typeof j.events=="string"){R=[j.events]}else{continue}}}else{continue}var e=j.id?j.id:"";var d=S.container?S.container:"";var Z=j.failureMessage?j.failureMessage:"";var W=S.successMessage?S.successMessage:"";var T=S.defaultMessage?S.defaultMessage:"";var X=S.messageContainer?S.messageContainer:"";var Q=S.shortLabel?S.shortLabel:"";var Y=j.conditions?j.conditions:[];var V=S.revalidateOnSuccess?S.revalidateOnSuccess:[];this.addCheck(new B.forms.ValidationCheck(h,U,g,R,{id:e,conditions:Y,container:d,failureMessage:Z,shortLabel:Q,successMessage:W,defaultMessage:T,messageContainer:X,revalidateOnSuccess:V}))}if(!S.validationGroups){continue}for(b in S.validationGroups){this.addValidationGroup(h,S.validationGroups[b])}}};F.Validator.prototype.importChecksObject=function(Q){var P=this;M.net.get(Q,{onLoad:function(R){P.parseChecksObject(R.json(false))}})};F.Validator.prototype.validate=function(S,P){if(typeof (S)=="undefined"){return false}if(typeof P=="undefined"){P={}}if(P.id&&typeof P.id=="string"){P.id=[P.id]}if(typeof P.id!="object"){P.id=[]}var f=this;var d={};d.opts=P;d.event=S;d.success=true;d.fields={};d.validationResult={};d.passedChecks=[];d.revalidateIds=[];d.tests=0;d.ajaxTests=0;var R=[];var U,Z,T,Y,X,Q,W,b,h,g,V;if(!this.checks.length){d.success=false}else{for(Z=0;Z<this.checks.length;Z++){U=this.checks[Z];if(d.opts.id.length){V=false;for(T in d.opts.id){if(d.opts.id[T]==U.field){V=true;break}}if(!V){continue}}V=false;for(Y in U.events){if(U.events[Y]==d.event){V=true;break}}if(!V){continue}R[R.length]=U}d.tests=R.length;for(Z=0;Z<R.length;Z++){U=R[Z];if(!(U.field in d.validationResult)){d.validationResult[U.field]={};d.validationResult[U.field]._valid=false;d.validationResult[U.field]._error=false}(function(c){c.doTest(d,{callback:function(e){f.validate_pt2(d,c,e)},validator:f})})(U)}}return true};F.Validator.prototype.validate_pt2=function(Q,P,R){if(!((P.field in Q.fields)&&!Q.fields[P.field])){if(R===0){Q.success=false;Q.fields[P.field]=false;Q.validationResult[P.field]._valid=false;Q.validationResult[P.field]._error=true;Q.validationResult[P.field].message=P.failureMessage;Q.validationResult[P.field].shortLabel=P.shortLabel}else{if(R===1&&!Q.validationResult[P.field]._valid){Q.fields[P.field]=true;Q.validationResult[P.field]._valid=false;Q.validationResult[P.field]._error=false;Q.validationResult[P.field].message=P.defaultMessage}else{if(R===2){Q.fields[P.field]=true;Q.validationResult[P.field]._error=false;Q.passedChecks[Q.passedChecks.length]=P.id;this.testValidationGroups(Q,P)}}}Q.validationResult[P.field].container=P.container;Q.validationResult[P.field].messageContainer=P.messageContainer}Q.tests--;this.validate_pt3(Q)};F.Validator.prototype.validate_pt3=function(P){if(P.tests!==0){return }if(!P.opts.preserveDOM){this.processValidationResult(P)}if(P.success){if(P.revalidateIds.length){this.validate(P.event,{id:P.revalidateIds,onFailure:P.opts.onFailure})}if(P.opts.onSuccess){P.opts.onSuccess(P.validationResult)}}else{if(P.opts.onFailure){P.opts.onFailure(P.validationResult)}}};F.Validator.prototype.testValidationGroups=function(Z,S){var W,Y,R,c,T,P;var X=false;for(W=0;W<this.validationGroups.length;W++){var U=this.validationGroups[W];if(U.field==S.field){var Q=true;for(Y in U.ids){var V=false;for(R=0;R<Z.passedChecks.length;R++){if(Z.passedChecks[R]==U.ids[Y]){V=true}}if(!V){Q=false;break}}if(!Q){continue}else{X=true;break}}}if(X){Z.validationResult[S.field]._valid=true;Z.validationResult[S.field].message=S.successMessage;if(S.revalidateOnSuccess.length){for(c=0;c<S.revalidateOnSuccess.length;c++){c=S.revalidateOnSuccess[c];var b=true;for(T in Z.opts.id){if(Z.opts.id[T]==c){b=false}}for(P=0;P<Z.revalidateIds.length;P++){if(Z.revalidateIds[P]==c){b=false}}if(b){Z.revalidateIds[Z.revalidateIds.length]=c}}}}else{Z.validationResult[S.field]._valid=false;Z.validationResult[S.field].message=S.defaultMessage}};F.Validator.prototype.processValidationResult=function(Q){var Z,Y,R=Q.validationResult,P=Q.event,S=[];for(Y in R){Z=R[Y];if(Y!="_valid"&&Y!="_error"){if(Z.message){K(Z.messageContainer).html(['<span class="t"></span>',Z.message,'<span class="b"></span>'].join(""))}else{K(Z.messageContainer).html("")}var W=K(Z.container);if(M.env.ie==6&&(W.is(".text, .password"))){W.get("input").each(function(){W.push(this)})}W.removeClass("error").removeClass("valid").removeClass("working");if(Z._valid){W.addClass("valid")}else{if(Z._error){W.addClass("error");if((Z.shortLabel!="")&&(S.join("|").indexOf(Z.shortLabel)==-1)){S[S.length]='<a href="'+Z.container+'">'+Z.shortLabel+"</a>"}}}}}if(P=="submit"){var X=K("#bbcidpagelevelerror");if(X.length>0){if(S.length>0){var U=S.length,T=M.i18n.getLocaleModule("BBCID"),V=T["pagelevelerror.and"],b="";while(U--){if(b==""){b=S[U]}else{b=S[U]+V+b;V=T["pagelevelerror.separator"]}}H(X,T,b)}else{O(X)}}}};var I=false;function H(Q,R,S){var T="<p>"+R["pagelevelerror.content"].replace("%ERRORLIST%",S)+"</p>";if(!I){Q.css({opacity:0,position:"absolute"});Q.removeClass("bbcidpagelevelnoerrors");Q.html(T);var P=Q.height();Q.css({height:0,position:""});var U=new M.anim.Animation(0.5,{tween:M.tweens.easeOut(),onFrame:function(){Q.css({height:this.value*P,opacity:this.value})},onComplete:function(){I=true}});U.start()}else{Q.html(T)}}function O(P){if(I){var Q=new M.anim.Animation(0.5,{tween:M.tweens.easeOut(),onFrame:function(){P.css({opacity:1-this.value})},onComplete:function(){P.addClass("bbcidpagelevelbusy").html("&nbsp;");I=false}});Q.start()}}F.Validator.prototype.stopAll=function(){var Q,P,R,S;for(P=0;P<this.checks.length;P++){Q=this.checks[P];if(Q.type=="ajax"){for(S=0;S<Q.requests.length;S++){R=Q.requests[S];R.abort()}}}};F.ValidationCheck=function(S,Q,T,P,R){this.field=S;this.type=Q;this.test=T;this.events=P;this.id=R.id?R.id:"";this.conditions=R.conditions?R.conditions:[];this.container=R.container?R.container:false;this.failureMessage=R.failureMessage?R.failureMessage:"";this.successMessage=R.successMessage?R.successMessage:"";this.defaultMessage=R.defaultMessage?R.defaultMessage:"";this.shortLabel=R.shortLabel?R.shortLabel:"";this.messageContainer=R.messageContainer?R.messageContainer:false;this.revalidateOnSuccess=R.revalidateOnSuccess?R.revalidateOnSuccess:[];this.requests=[]};F.ValidationCheck.prototype.doTest=function(Z,P){var b=this,Q=P.validator;this.v=Z;if(!K(["#",this.field].join("")).length){P.callback(1);return }if(this.conditions.length){var T=false,Y,U,X,S;this.conditionCounter=this.conditions.length;for(Y=0;Y<this.conditions.length;Y++){U=this.conditions[Y];if("exceptions" in U){S=false;for(X in U.exceptions){if(U.exceptions[X]==Z.event){S=true;break}}if(S){this.doTest_pt2(true,P);return }}if("events" in U){S=false;for(X=0;X<U.events.length;X++){if(U.events[X]==Z.event){S=true;break}}if(!S){this.doTest_pt2(false,P);return }}U.id=U.id?U.id:this.field;var c=K(["#",U.id].join(""));if(M.env.ie){c=c.filter(function(){return this.id==U.id})}var R=K("#"+U.id+"_container");var V;if(c.length){V=c.val()}else{if(R.hasClass("radioGroup")){c=R.get("input").filter(function(){return(K(this).attr("type")=="radio")});c.each(function(){var d=K(this).val();V=d||V})}}if((U.type=="regex"&&V.match(U.test))||(U.type=="lt"&&V<U.test)||(U.type=="lte"&&V<=U.test)||(U.type=="eq"&&V==U.test)||(U.type=="eqv"&&V===U.test)||(U.type=="gte"&&V>=U.test)||(U.type=="gt"&&V>U.test)||(U.type=="neq"&&V!=U.test)||(U.type=="neqv"&&V!==U.test)||(U.type=="match"&&V==K(U.test)[0].value)||(U.type=="notmatch"&&V!=K(U.test)[0].value)||(U.type=="function"&&U.test.call({glow:M},V))||(U.type=="checked"&&c.attr("type")=="checkbox"&&((c.attr("checked")=="checked"&&U.test===true)||(c.attr("checked")!="checked"&&U.test===false)))||(U.type=="email"&&V.match(N))||(U.type=="numeric"&&V.match(/^[0-9]*$/))||(U.type=="empty"&&V=="")||(U.type=="notempty"&&V.match(/^.+$/))||(U.type=="oneselected"&&this.radioButtonSelected(c,U.test))||(U.type=="required"&&K(this.container+".required").length)||(U.type=="optional"&&!K(this.container+".required").length)){this.doTest_pt2(true,P)}else{if(U.type=="ajax"){Z.ajaxTests++;if(U.test.substring(0,5)!="https"){var W=K(this.container);if(M.env.ie==6&&W.is(".text, .password")){W.push(W.get("input"))}W.addClass("working");(function(){var d=b.requests.length;b.requests[d]=M.net.get([U.test,V].join(""),{onLoad:function(e){Z.ajaxTests--;if(Z.ajaxTests==0){W.removeClass("working")}if(e.text().replace(/^[\s]+/g,"").replace(/[\s]+$/g,"")==="1"){b.doTest_pt2(true,P)}else{b.doTest_pt2(false,P)}},onError:function(e){if(e.status==408){P.callback(1)}},timeout:5})})()}}else{if(U.type=="valid"){if(U.id&&Q){Q.validate(Z.event,{id:U.id,onFailure:function(){b.doTest_pt2(false,P)},onSuccess:function(){b.doTest_pt2(true,P)}})}else{this.doTest_pt2(false,P)}}else{this.doTest_pt2(false,P)}}}}}else{this.doTest_pt3(P)}};F.ValidationCheck.prototype.doTest_pt2=function(Q,P){if(Q){this.conditionCounter--;if(this.conditionCounter===0){this.doTest_pt3(P)}}else{P.callback(1)}};F.ValidationCheck.prototype.doTest_pt3=function(Q){var R=K(["#",this.field].join(""));if(M.env.ie){R=K(["input#",this.field,",textarea#",this.field,",select#",this.field].join(""))}var T=K(this.container);var P=this;var V;if(R.length){V=R.val()}else{if(T.hasClass("radioGroup")){R=T.get("input").filter(function(){return(K(this).attr("type")=="radio")});R.each(function(){var W=K(this).val();V=W||V})}}if((this.type=="regex"&&V.match(this.test))||(this.type=="lt"&&V<this.test)||(this.type=="lte"&&V<=this.test)||(this.type=="eq"&&V==this.test)||(this.type=="eqv"&&V===this.test)||(this.type=="gte"&&V>=this.test)||(this.type=="gt"&&V>this.test)||(this.type=="neq"&&V!=this.test)||(this.type=="neqv"&&V!==this.test)||(this.type=="match"&&V==K(this.test).val())||(this.type=="notmatch"&&V!=K(this.test).val())||(this.type=="function"&&this.test.call({glow:M},V))||(this.type=="checked"&&R.attr("type")=="checkbox"&&((V==R.attr("value")&&this.test===true)||(V==""&&this.test===false)))||(this.type=="email"&&V.match(N))||(this.type=="numeric"&&V.match(/^[0-9]*$/))||(this.type=="notempty"&&V.match(/^.+$/))||(this.type=="oneselected"&&this.radioButtonSelected(R,this.test))){Q.callback(2)}else{if(this.type=="ajax"){this.v.ajaxTests++;if(this.test.substring(0,5)!="https"){var U=P.requests.length;var S=K(this.container);if(M.env.ie==6&&S.is(".text, .password")){S.push(S.get("input"))}S.addClass("working");P.requests[U]=M.net.get([this.test,V].join(""),{onLoad:function(W){P.v.ajaxTests--;if(P.v.ajaxTests==0){S.removeClass("working")}if(W.text().replace(/^[\s]+/g,"").replace(/[\s]+$/g,"")==="1"){Q.callback(2)}else{Q.callback(0)}},onError:function(W){if(W.status==408){Q.callback(1)}},timeout:5})}return }else{Q.callback(0)}}};F.ValidationCheck.prototype.radioButtonSelected=function(Q,R){var P=false;Q.each(function(){var S=K(this).val();if(S!=""){if(!R){P=true}for(a=0;a<R.length;a++){if(R[a]==S){P=true}}}});return P};F.ValidationGroup=function(Q,P){this.field=Q;this.ids=P};F.ValidationGroup.prototype.contains=function(P){for(thisid=0;thisid<this.ids.length;thisid++){if(P==this.ids[thisid]){return true}}return false};F.SecureForm=function(R,Q){this.form=K(R);if(Q.secureUrl){this.secureUrl=Q.secureUrl}else{var P=this.form.attr("action");if(P.substr(0,5)=="https"){this.secureUrl=P}else{if(P.substr(0,4)=="http"){this.secureUrl=["https",P.substr(4)].join("")}else{return false}}}this.handleResult=Q.handleResult||function(){};this.arrayId=J.length;J[this.arrayId]=this;return true};F.SecureForm.prototype.submit=function(W){K("#id-secureform").remove();this.iframe=M.dom.create('<iframe src="javascript:false" id="id-secureform" name="id-secureform"></iframe>');this.iframe.css("visibility","hidden").css("position","absolute").css("left","-9999px").css("top","-9999px");K("body").append(this.iframe);var S=M.dom.create("<div></div>");var R=97;this.fieldNames={};var P=this;this.form.get("input, select, textarea").each(function(){var X=K(this);if(X.attr("name")!="cancel"){if(X.is("input")&&X.attr("type")=="checkbox"&&X.val()!=X.attr("value")){return }var Y=M.dom.create(["<input type='hidden' name='",X.attr("name"),"' />"].join("")).attr("value",X[0].value);S.append(Y);if(X.attr("name")!="register"){Y=M.dom.create(["<input type='hidden' name='",String.fromCharCode(R),"' />"].join("")).attr("value",X.attr("name"));S.append(Y)}P.fieldNames[String.fromCharCode(R++)]=X.attr("name")}});var T,V,Q=B.util.random(6);if(M.env.opera){T=C.frames[0].document}else{V=K("#id-secureform")[0];if(V.contentDocument){T=V.contentDocument}else{if(V.contentWindow){T=V.contentWindow.document}else{if(V.document){T=V.document}}}}T.open();T.write("<html><head></head><body>");T.write(['<form id="id-secureform" name="id-secureform" action="',this.secureUrl,'" method="post">'].join(""));T.write(['<input type="hidden" name="secureform_id" value="',this.arrayId,'" />'].join(""));T.write(['<input type="hidden" name="salt" value="',Q,'" />'].join(""));T.write(S[0].innerHTML);T.write("</form></body></html>");T.close();this.iframeForm=K(T).get("form");B.util.deleteCookie("IDENTITY-ERRORS");this.iframeForm[0].submit();var U=setInterval(function(){var Z=unescape(B.util.getCookie("IDENTITY-ERRORS"));var b=Z.split("*");var Y={id:b[0],salt:b[1],value:b[2]};if((Y.salt==Q)||(!Y.salt&&Y.value&&Y.value.length==1)){var X=W(Y.value,P.fieldNames);P.handleResult(X);K("#id-secureform").remove();clearInterval(U);B.util.deleteCookie("IDENTITY-ERRORS")}},100)};F.init=function(P){M=P;K=M.dom.get;G=M.events.addListener;L=M.events.removeListener};return F}();if(B&&B.resourceLoaded){B.resourceLoaded("id-forms.js")}idPanelObj=function(){var P,M,G,N,F={};var H=".panel-identity",O="panel-noHeader",K="c",J="hd",L="ft";idPanel=function(){arguments.callee.base.apply(this,arguments);this.getDrawer();var Q=this;G(C,"scroll",function(R){if(Q.container.css("position")=="absolute"){Q.handleScroll(R)}})};idPanel.prototype.handleScroll=function(U){var W=P.widgets._scrollPos().y,V=W-(this.previousScrollPosition||0),Q=M(C).height(),S=this.container.height(),T=parseInt(this.container.css("top"),10)-W,R=S+T;if(V>0){if(R<Q){this.container.css("top",(Q-S+W)+"px")}}else{if(V<0){if(T>0){this.container.css("top",W+"px")}}}this.previousScrollPosition=W};idPanel.prototype.showWith=function(T,R){R=(typeof (R)=="undefined")?{}:R;R.callback=("callback" in R)?R.callback:function(){};var U=(this.content.parent().css("visibility")=="visible");panelcontent=this.content.get(".c");var S=this.getMetrics(R);this.body.empty().append(T).css("visibility","hidden");this.content.addClass("blq-rst");P.dom.get(H).removeClass(O);this.header.empty().append(this.body.get([".",J].join("")).remove()).css("visibility","hidden");if(this.header.length===0){P.dom.get(H).addClass(O)}this.footer.empty().append(this.body.get([".",L].join("")).remove()).css("visibility","hidden");var V=this.recalculateDimensions(U,S);if(U){this.content.css("width",[S.origwidth,"px"].join(""));this.content.parent().css("width",[S.origwidth,"px"].join(""));panelcontent.css("height",[S.origheight,"px"].join(""));panelcontent.css("overflow","hidden");this.body.css("display","none");this.header.css("display","none");this.footer.css("display","none");var Q=this;this.morph(V.width,V.height,{duration:0.2,onComplete:function(){Q.body.css("display","block").css("visibility","visible");Q.header.css("display","block").css("visibility","visible");Q.footer.css("display","block").css("visibility","visible");P.dom.get(H).parent().css("overflow","visible");R.callback()}})}else{this.body.css("visibility","visible");this.header.css("visibility","visible");this.footer.css("visibility","visible");panelcontent.css("height",V.height);this.content.css("width",V.width);P.dom.get(H).parent().css("overflow","visible");this.content.get([".",K].join("")).css("overflow","visible");R.callback()}};idPanel.prototype.morph=function(R,f,Y){var g=this;this.show();Y=(typeof (Y)=="undefined")?{}:Y;Y.duration=("duration" in Y)?Y.duration:0.5;Y.onComplete=("onComplete" in Y)?Y.onComplete:function(){};var c=function(){Y.onComplete();var h=g.content.get([".",K].join(""))};var V=this.content.get([".",K].join(""));var Q=[this.content,this.content.parent()];var d=this.content.parent();var Z=P.anim.css(V,Y.duration,{height:{to:f}},{});var T=[];for(var U=0;U<Q.length;U++){T[U]=P.anim.css(Q[U],Y.duration,{width:{to:R}},{})}var b=(parseInt(d.offset().top,10)+((V.height()-parseInt(f,10))/2));var S=(parseInt(d.offset().left,10)+((Q[0].width()-parseInt(R,10))/2));b=(b<0)?0:b;S=(S<0)?0:S;var X=P.anim.css(d,Y.duration,{top:{to:[b,"px"].join("")}},{});var W=P.anim.css(d,Y.duration,{left:{to:[S,"px"].join("")}},{});var e;if((parseInt(R,10)!=Q[0].width())&&(parseInt(f,10)!=V.height())){e=new P.anim.Timeline([[T[0]],[T[1]],[Z],[X],[W]])}else{if(parseInt(R,10)!=Q[0].width()){e=new P.anim.Timeline([[T[0]],[T[1]],[W]])}else{if(parseInt(f,10)!=V.height()){e=new P.anim.Timeline([[Z],[X]])}}}if(typeof e!="undefined"){P.events.addListener(e,"complete",function(){c()});e.start()}else{c()}};idPanel.prototype.collapse=function(Q){if(typeof Q=="undefined"){Q={}}if(!("onComplete" in Q)){Q.onComplete=function(){}}this.hideContent();this.morph(100,65,{duration:0.2,onComplete:Q.onComplete})};idPanel.prototype.getMetrics=function(T){var S=this.contentIsVisible();var R=this.isVisible();if(!R){}this.showContent();this.show();T=(typeof (T)=="undefined")?{}:T;T.width=("width" in T)?T.width:"355px";T.height=("height" in T)?T.height:"auto";var U={};var Q=this.content.get([".",K].join(""));U.maxheight=P.dom.get(C).height()-50;U.maxwidth=P.dom.get(C).width()-50;U.origheight=Q.height();U.origwidth=this.container.width();U.requiredheight=T.height;U.requiredwidth=T.width;if(!R){this.hide()}if(!S){this.hideContent()}if(this.container.css("visibility")=="hidden"){}return U};idPanel.prototype.recalculateDimensions=function(W,V){var U=this.contentIsVisible();var S=this.isVisible();this.showContent();if(!(P.env.ie<7)){this.show()}var R=this.content.get([".",K].join(""));R.css("height",V.requiredheight);this.content.css("width",V.requiredwidth).parent().css("width",V.requiredwidth);if(!W){this.show()}var Q="";if(V.requiredwidth=="retain"){Q=V.origwidth}else{if(V.requiredwidth=="auto"){Q=[this.content.width(),"px"].join("")}else{Q=V.requiredwidth}}if(parseInt(Q,10)>V.maxwidth){Q=V.maxwidth;R.addClass("xscroll")}this.content.css("width",[parseInt(Q,10),"px"].join(""));var T="";if(V.requiredheight=="retain"){T=V.origheight}else{if(V.requiredheight=="auto"){T=R.height()}else{T=V.requiredheight}}if(!S){this.hide()}if(!U){this.hideContent()}return{width:[parseInt(Q,10),"px"].join(""),height:[parseInt(T,10),"px"].join("")}};idPanel.prototype.hideContent=function(){this.header.css("display","none");this.body.css("display","none");this.footer.css("display","none")};idPanel.prototype.showContent=function(){this.header.css("display","block");this.body.css("display","block");this.footer.css("display","block")};idPanel.prototype.contentIsVisible=function(){return(this.body.css("display")=="block")};idPanel.prototype.isVisible=function(){return(this.content.parent().css("visibility")=="visible")};idPanel.prototype.hasDrawer=function(){return(this.drawer)?true:false};idPanel.prototype.getDrawer=function(){if(!this.drawer){this.drawer=new I(this)}return this.drawer};var I=function(S){this._panel=S;this._state="";this._timeline=new P.anim.Timeline([]);this._windowResizeListenerId="";this._scrollListenerId="";var R=this;if(!M(".id-panel-drawer").length){var Q=P.dom.create('<div class="id-panel-drawer-container glowNoMask"><div class="id-panel-drawer"><div class="topbar"></div><div class="content"><div class="hd"></div><a href="#" class="close">Close</a><div class="bd"></div><div class="ft"></div></div><div class="bottombar"></div></div></div>');M("body").append(Q);G(".id-panel-drawer .close","click",function(T){T.preventDefault();R.close()},this);this._drawer=Q.get(".id-panel-drawer");this._container=Q;this.hide()}else{this._container=M(".id-panel-drawer-container");this._drawer=M(".id-panel-drawer")}};I.prototype._width=307;I.prototype.open=function(S){if(this._state=="closing"){this._timeline.stop();this._state="closed"}if(this._state=="closed"){var Q=P.anim.css(this._drawer,0.5,{left:{from:[this._width,"px"].join(""),to:"0px"}},{tween:P.tweens.easeOut()});this._timeline=new P.anim.Timeline([Q]);var R=this;P.events.addListener(this._timeline,"complete",function(){R._state="open";if(typeof S=="object"&&"onComplete" in S){S.onComplete()}});this._container.css("display","block");this._timeline.start();this._state="opening"}else{if(this._state=="open"&&typeof S=="object"&&"onComplete" in S){S.onComplete()}}return this};I.prototype.close=function(S){if(this._state=="opening"){this._timeline.stop();this._state="open"}if(this._state=="open"){var Q=P.anim.css(this._drawer,0.5,{left:{to:[this._width,"px"].join("")}},{tween:P.tweens.easeIn()});this._timeline=new P.anim.Timeline([Q]);var R=this;P.events.addListener(this._timeline,"complete",function(){R._container.css("display","none");R._state="closed";if(typeof S=="object"&&"onComplete" in S){S.onComplete()}});this._timeline.start();this._state="closing"}else{if(this._state=="closed"&&typeof S=="object"&&"onComplete" in S){S.onComplete()}}return this};I.prototype.show=function(){if(this._state!="open"){this._timeline.stop();this._container.css("display","block");this._drawer.css("left","0");this._state="open"}return this};I.prototype.hide=function(){if(this._state!="closed"){this._timeline.stop();this._container.css("display","none");this._drawer.css("left",[this._width,"px"].join(""));this._state="closed"}return this};I.prototype.update=function(W){N(this._windowResizeListenerId);N(this._scrollListenerId);this._content=W;var Q=this._drawer.get(".bd");var T=this._drawer.get(".hd");var S=this._drawer.get(".ft");Q.css("display","none");Q.empty();T.empty();S.empty();Q.html(P.dom.create(this._content).html());var U=Q.get(".hd");var V=Q.get(".ft");if(U.length){T.html(U.remove().html())}if(V.length){S.html(V.remove().html())}this.setPosition();Q.css("display","block");var R=this;this._windowResizeListenerId=G(C,"resize",function(){R.setPosition()},R);this._scrollListenerId=G(C,"scroll",function(X){R.setPosition()});return this};I.prototype.setPosition=function(){var R=this._panel.content.parent();var V=this._panel.content.get(".c");var Q=this._drawer.get(".content");if(this._state=="open"||this._state=="closed"){this._container.css("display","block");var T=(V.height()-V.get(".panel-hd").height());var S=(T-this._drawer.get(".topbar").height()-this._drawer.get(".bottombar").height());S=(S<0)?0:S;this._container.css("width",[this._width,"px"].join("")).css("z-index",R.css("z-index")-1).css("position","absolute").css("top",[V.get(".panel-hd").offset().top+V.get(".panel-hd").height(),"px"].join("")).css("left",[V.offset().left-this._width,"px"].join("")).css("width",[this._width,"px"].join("")).css("height",[T,"px"].join(""));this._drawer.css("padding",[this._drawer.get(".topbar").height(),"px 0 ",this._drawer.get(".bottombar").height(),"px 0"].join("")).css("width",[this._width,"px"].join("")).css("height",[S,"px"].join("")).css("top","0").css("left",[(this._state=="open")?"0":this._width,"px"].join("")).css("position","relative");Q.height(0);Q.height(this._drawer.height());var U=(Q.height()-Q.get(".hd").height()-Q.get(".ft").height()-2);U=(U<0)?0:U;Q.get(".bd").height([U,"px"].join(""))}if(this._state=="closed"){this._container.css("display","none");this._drawer.css("left",[this._width,"px"].join(""))}return this};idPanel.prototype.drawer=false;F.init=function(Q){P=Q;M=P.dom.get;G=P.events.addListener;N=P.events.removeListener;P.lang.extend(idPanel,P.widgets.Panel,idPanel.prototype)};return F}();idInfoPanelObj=function(){var I,H,F,G={};idInfoPanel=function(){arguments.callee.base.apply(this,arguments);this.container.width(280)};idInfoPanel.prototype.setHeight=function(){};idInfoPanel.prototype.setOffsetInContext=function(J){this.opts.offsetInContext=J};G.init=function(J){I=J;H=I.dom.get;F=I.events.addListener;removeListener=I.events.removeListener;I.lang.extend(idInfoPanel,I.widgets.InfoPanel,idInfoPanel.prototype)};return G}();if(B&&B.resourceLoaded){B.resourceLoaded("id-glow-panel-extensions.js")}B=B||{};B.status=function(){var G={},R,K,H,L,O={},I=false,N,F={},J,Q,M=false;D.panelAppearTimeout=8000;D.panelActionTimeout=8000;D.css_id_status="id-status";D.css_element_status=["#",D.css_id_status].join("");D.css_element_status_allLinks=["#",D.css_id_status," a"].join("");D.css_element_status_allPtrtLinks=["#",D.css_id_status," a.has-ptrt"].join("");D.css_element_status_signinLink=["#",D.css_id_status," a.idSignin"].join("");D.css_element_status_registerLink=["#",D.css_id_status," a.idRegister"].join("");D.css_element_status_settingsLink=["#",D.css_id_status," a.idSettings"].join("");D.css_element_status_signoutLink=["#",D.css_id_status," a.idSignout"].join("");D.url_status="/users/widget/status";var P=function(){B.removeSigninHandler=B.removeHandler;B.removeSigninCancelHandler=B.removeHandler;B.removeStatusbarRefreshHandler=B.removeHandler;B.addLoginHandler=B.addSigninHandler;B.removeLoginHandler=B.removeSigninHandler;B.showLoginPanel=B.showSigninPanel;B.addLoginCancelHandler=B.addSigninCancelHandler;B.removeLoginCancelHandler=B.removeSigninCancelHandler};G.getUserStatus=function(){var S,T={},U=B.util.getCookie("IDENTITY");S=U?U.split("%7C"):null;if(U!=S&&S.length==4){T.username=U[1];T.userid=U[0];T.status="loggedin"}else{T.username="";T.status="loggedout";T.userid=0}return T};G.hasChanged=function(U){var W,S=(typeof U!="undefined"&&U.suppressActions)?true:false,T=B.status.getUserStatus();W=((T.status!=F.status)||(T.userid!=F.userid))?true:false;if(W&&!S){var V;if(T.status=="loggedin"){V=new R.events.Event();R.events.fire(B,"signin",V)}}F=T;return W};G.loadAndShowPanel=function(S,T){if(typeof T!="string"){T=false}B.showPanel(T,S)};P();G.refresh=function(){B.statusbar.refresh()};G.enableJavaScript=function(){B.enableJavaScript()};G.init=function(S){R=S;K=R.dom.get;H=R.events.addListener;L=R.events.removeListener;F=B.status.getUserStatus();if(!R.isSupported||navigator.userAgent.match(/^.*mobile.*$/i)||navigator.userAgent.match(/^.*blackberry.*$/i)||navigator.userAgent.match(/^.*opera mini.*$/i)||navigator.userAgent.match(/^.*windows ce.*$/i)||(navigator.userAgent.match(/^.*ppc.*$/i)&&!navigator.userAgent.match(/^.*ppc\smac.*$/i))||navigator.userAgent.match(/^.*symbian.*$/i)||navigator.userAgent.match(/^.*avantgo.*$/i)||navigator.userAgent.match(/^.*opera mini.*$/i)||navigator.userAgent.match(/^.*wii.*$/i)||navigator.userAgent.match(/^.*playstation.*$/i)){return }};G.showDisplayName=function(){var S=decodeURIComponent(B.util.getCookie("IDENTITY").replace("+"," ")).split("|");K("#id-status .idUsername").each(function(){K(this).text(S[2]||S[1])})};return G}();B.util=function(){var H=B.util||{},J,I,F,G;H.authorized=function(K){return B.user.isAuthorised(K)};H.setCookie=function(M,N,O){var K,L;if(O){L=new Date();L.setTime(L.getTime()+(O*24*60*60*1000));K=[";expires=",L.toGMTString()].join("")}else{K=""}A.cookie=[M,"=",N,K,";path=/;domain=.bbc.co.uk"].join("")};H.deleteCookie=function(K){B.util.setCookie(K,"",-1)};H.getArgsFromUrl=function(M){var L=[],N="",O=M.split("?");if(O.length>1){var K="";for(urlPartsIndex=0;urlPartsIndex<O.length;urlPartsIndex++){if(urlPartsIndex!=0){K+=((K=="")?"":"?")+O[urlPartsIndex]}}O=[O[0],K];N=O[1].split("&");if(N.length>=1){for(argIndex=0;argIndex<N.length;argIndex++){argParts=N[argIndex].split("=");L[argParts[0]]=argParts[1]}}}return L};H.random=function(O){var M="";var N="bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ0123456789";for(var L=0;L<O;L++){var K=new Date();M=[M,N.charAt(Math.floor(Math.random(K.getTime())*N.length))].join("")}return M};H.var_dump=function(S,M,K){var N="";if(!M){M=20}if(!K){K=1}var L="  ";var Q="";for(var O=0;O<K;O++){Q=[Q,L].join("")}if(typeof (S)=="object"){N=[N,"{\n"].join("");var P=true,R;for(R in S){N=[N,(K>=M)?"...":Q,'"',R,'": ',var_dump(S[R],M,K+1),",\n"].join("");P=false}if(P){N=[N.substr(0,N.length-1),"}"].join("")}else{N=[N.substr(0,N.length-2),"\n",Q.substr(0,Q.length-L.length),"}"].join("")}}else{if(typeof (S)=="string"){N=[N,('"'+S+'"')].join("")}else{if(typeof (S)=="boolean"){N=[N,(S?"true":"false")].join("")}else{if(typeof (S)=="function"){N=[N,"function"].join("")}else{N=[N,(S)].join("")}}}}return N};H.getScrollPosition=function(L){if(typeof L=="undefined"){L=""}var K=0,M=0;if(typeof (C.pageYOffset)=="number"){K=C.pageXOffset;M=C.pageYOffset}else{if(A.body&&(A.body.scrollLeft||A.body.scrollTop)){K=A.body.scrollLeft;M=A.body.scrollTop}else{if(A.documentElement&&(A.documentElement.scrollLeft||A.documentElement.scrollTop)){K=A.documentElement.scrollLeft;M=A.documentElement.scrollTop}}}if(L=="x"){return K}else{if(L=="y"){return M}else{return{x:K,y:M}}}};H.init=function(K){J=K;I=J.dom.get;F=J.events.addListener;G=J.events.removeListener;if(!("console" in C)){C.console=function(){var M={},P,O,N,L=false;M.enable=function(){L=true};M.disable=function(){L=false};M.clear=function(){N.empty()};M.log=function(Q){if(L){if(typeof (N)=="undefined"){N=P.dom.create('<p id="console-log" style="position: fixed; bottom: 0; left: 0; height: 100px; width: 100%; overflow-y: auto; overflow-x: noscroll;background: white;border-top: 1px solid gray;"></p>');O("body").append(N);O("body").css("padding-bottom","100px");if(P.env.ie&&P.env.ie<=6){O("#console-log").css("position","absolute");setInterval(function(){N.css("height","99px");N.css("height","100px")},250)}}N.append([Q,"<br />"].join(""));N[0].scrollTop=N[0].scrollHeight}};M.init=function(Q){P=Q;O=P.dom.get};return M}();console.init(J)}};return H}();if(B&&B.resourceLoaded){B.resourceLoaded("id-status.js")}})(window,document);
