Closed lanzelot1989 closed 9 years ago
the file gets corrupted and has the error: "cannot read property '1' of undefined"
That's a Javascript runtime error, and might be a timing issue. Note that the instrumented code will run more slowly. Can you investigate to see if this is possibly the problem.
I re-formatted your code (show below):
$(document).on("mobileinit", function () {
$.mobile.defaultPageTransition = "none",
$.mobile.defaultDialogTransition = "none",
$.mobile.hashListeningEnabled = !1,
$.mobile.linkBindingEnabled = !0,
$.mobile.ignoreContentEnabled = !0,
$.mobile.transitionFallbacks.slide = "none",
$.mobile.transitionFallbacks.slideup = "none";
});
$(function () {
$("body").removeClass("s-hidden"),
$("div[data-role='header'], " + "div[data-role='footer']").enhanceWithin().toolbar(),
$("div[data-role='panel']").enhanceWithin().panel(),
$("div[data-role='popup']").enhanceWithin().popup();
});
...when I instrumented, I got the code below which appears unchanged except for the extra coverage statements.
_$jscoverage['/script.js'].lineData[1]++;
$(document).on("mobileinit", function () {
_$jscoverage['/script.js'].functionData[0]++;
_$jscoverage['/script.js'].lineData[2]++;
$.mobile.defaultPageTransition = "none",
$.mobile.defaultDialogTransition = "none",
$.mobile.hashListeningEnabled = !1,
$.mobile.linkBindingEnabled = !0,
$.mobile.ignoreContentEnabled = !0,
$.mobile.transitionFallbacks.slide = "none",
$.mobile.transitionFallbacks.slideup = "none";
});
_$jscoverage['/script.js'].lineData[11]++;
$(function () {
_$jscoverage['/script.js'].functionData[1]++;
_$jscoverage['/script.js'].lineData[12]++;
$("body").removeClass("s-hidden"),
$("div[data-role='header'], " + "div[data-role='footer']").enhanceWithin().toolbar(),
$("div[data-role='panel']").enhanceWithin().panel(),
$("div[data-role='popup']").enhanceWithin().popup();
});
If there is a corruption, can you point to the specific corruption?
In another JavaScript file I could pinpoint the line of the corruption (marked with the comment "here"):
...
if (! _$jscoverage['/main.min.js'].branchData) {
_$jscoverage['/main.min.js'].branchData = {};
... // omitted
_$jscoverage['/main.min.js'].branchData['2054'] = [];
_$jscoverage['/main.min.js'].branchData['2054'][1] = new BranchData();
}
_$jscoverage['/main.min.js'].branchData['2054'][1].init(21426, 20, 'BAHWeb.General || {}'); // here
function visit1606_2054_1(result) {
_$jscoverage['/main.min.js'].branchData['2054'][1].ranCondition(result);
return result;
}
_$jscoverage['/main.min.js'].branchData['2047'][2]...
It seems that these lines are not executed:
_$jscoverage['/main.min.js'].branchData['2054'] = [];
_$jscoverage['/main.min.js'].branchData['2054'][1] = new BranchData();
In another JavaScript file I could pinpoint the line of the corruption
Can you also provide the original source or snippet so that I can reproduce it?
Also, if the condition in if (! _$jscoverage['/main.min.js'].branchData) {
is false, can you debug and let me know what is in _$jscoverage['/main.min.js'].branchData
and where it could be set (it shouldn't be).
If not, the another possible thing stopping execution is an exception being thrown - can you find one.
Here you go:
function compareDate(n,t){return n.GetDate().getTime()-t.GetDate().getTime()}function compareId(n,t){return n.GetId()-t.GetId()}function WebForm_FireDefaultButton(n,t){var r=n.srcElement||n.target,i,u;if(n.keyCode==13&&!(r&&r.tagName.toLowerCase()=="textarea")){if(i=$("#"+t)[0],typeof i.click!="undefined")return i.click(),global.StopPropagation(n),!1;if(typeof i.href!="undefined")return u=window.unescape(i.href.substr(11)),eval(u),global.StopPropagation(n),!1}return!0}function EnableValidators(n,t,i){validation.EnableValidators(n,t,i)}function DisableValidators(n,t){validation.DisableValidators(n,t)}function EnsureSubmitOnce(n,t){return validation.EnsureSubmitOnce(n,t)}var global,behaviors,PromotionBehavior,gtc,validation,conversion,italy,googleAnalytics;Array.prototype.indexOf=function(n){for(var t=0;t<this.length;t++)if(this[t]===n)return t;return-1};Array.prototype.contains=function(n){return this.indexOf(n)>-1};Array.prototype.containsId=function(n){for(var t=0;t<this.length;t++)if(this[t].id==n)return t;return-1};Array.prototype.sortBySortOrder=function(){this.sort(function(n,t){return n.sortOrder!=t.sortOrder?n.sortOrder-t.sortOrder:n.id-t.id})};Array.prototype.sortByDate=function(){this.sort(function(n,t){return compareDate(n,t)})};Array.prototype.sortByDateDesc=function(){this.sort(function(n,t){return compareDate(t,n)})};Array.prototype.sortById=function(){this.sort(function(n,t){return compareId(n,t)})};Array.prototype.sortByIdDesc=function(){this.sort(function(n,t){return compareId(t,n)})};Array.prototype.sortByDateAndId=function(){return this.sortByDateAndId(!1)};Array.prototype.sortByDateAndIdDesc=function(){return this.sortByDateAndId(!0)};Array.prototype.sortByDateAndId=function(n){this.sort(function(t,i){var r=t,u=i,f;return(n&&(r=i,u=t),f=compareDate(r,u),f===0)?compareId(r,u):f})};Number.prototype.toFixedDecimal=function(){return Math.round(this*100)/100};String.prototype.replaceAt=function(n,t){return this.substr(0,n)+t+this.substr(n+t.length)};String.prototype.replaceAll=function(n,t){return this.split(n).join(t)};String.prototype.contains=function(n,t){return t=typeof t!="undefined"?t:0,this&&this!==null&&this.indexOf(n,t)!=-1};String.prototype.startsWith=function(n){return this&&this!==null&&this.indexOf(n)===0};String.prototype.FormatOdd=function(){return this&&this!==null&&!isNaN(this)&&parseFloat(this)>1?parseFloat(this).toFixed(2):"--"};Number.prototype.FormatOdd=function(){return this&&this!==null&&!isNaN(this)&&this>1?this.toFixed(2):"--"};String.prototype.FormatAmount=function(n){return n=typeof n!="undefined"?n:2,this&&this!==null&&!isNaN(this)?parseFloat(this).toFixed(n):0..toFixed(n)};Number.prototype.FormatAmount=function(n){return n=typeof n!="undefined"?n:2,this&&this!==null&&!isNaN(this)?this.toFixed(n):0..toFixed(n)};Date.prototype.FormatServiceDate=function(){return"/Date("+this.getTime()+")/"};BAHWeb.Global=function(){this.flashReferences={};this.idleTimeoutId=0;this.idleWarningTimeoutId=0;this.timeoutWindowOpen=!1;this.timeoutWarningWindowOpen=!1;this._gamingWinFrameWidth=323;this._gamingWinFrameHeight=136};BAHWeb.Global.prototype={Init:function(){$(document).ajaxError(this.OnAjaxError);$(document).ajaxSuccess(this.OnAjaxCompleted);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this.OnASPRequestCompleted);Sys.Net.WebRequestManager.add_completedRequest(this.OnASPRequestCompleted);window.onerror=this.OnError;var n=this._getInternetExplorerVersion();$.fx.off=!$.support.opacity||n!=-1&&n<=9;this.Slow=$.fx.off?0:600;this.Fast=$.fx.off?0:300;global.bahTime=new Date;this.OnCachedControls();this.aliveInterval=BAHWeb.Variables.AliveInterval?BAHWeb.Variables.AliveInterval:0;this.aliveInterval>0&&window.setInterval(function(){$.ajax({url:BAHWeb.Variables.BaseUrl+"/ajax/alive"})},this.aliveInterval);this.ResetSessionTimeoutWarning();n===7&&$("iframe").attr("type","")},IsOpenerSameDomain:function(){try{var n=window.opener&&!window.opener.closed&&window.opener.document&&window.opener.document.getElementById("sameDomainHidden");return n&&n.value=="www.bet-at-home.com"}catch(t){return!1}},OnCachedControls:function(){},OnASPRequestCompleted:function(n){n&&n._xmlHttpRequest&&global.OnAjaxCompleted(n,n._xmlHttpRequest)},OnAjaxCompleted:function(n,t){if(t.responseText&&t.responseText.contains('id="maintenance-page"')){global.ReloadForMaintenance();return}var i=t.getResponseHeader("X-BAH-ClientState");i&&i.length>0&&global.OnClientResponseState(i);global.ResetSessionTimeoutWarning()},OnAjaxError:function(n,t,i,r){if(t.status!==0&&t.readyState!==0){global.OnAjaxCompleted(n,t);var u="OnAjaxError Url: "+i.url+" Type: "+i.type+" HttpStatus: "+t.status+" - "+r;global.LogError(u)}},LogError:function(n){Sys.Debug.trace(n);var t=1e4;n.length>t&&(n=n.toString().substring(0,t));n=encodeURIComponent("Href: "+window.location.href+" \t\tMessage: "+n+" \t\tClient: "+navigator.userAgent);$.ajax({type:"POST",url:BAHWeb.Variables.BaseUrl+"/svc/scripterr",data:{log:n},global:!1})},OnError:function(n,t,i){var r="Error - File: "+t+" - Line: "+i+" - Message: "+n;global.LogError(r)},OnClientResponseState:function(n){var t=decodeURIComponent(n).split("|"),i=parseInt(t[0],10);Sys.Debug.trace("Global - ClientAjaxResponseState: "+n);switch(i){case 1:global.OnSessionTimeout(t);break;case 2:global.OnBalanceUpdate(t);break;case 3:behaviors.ShowDialog({caption:t[1],message:t[2]})}},ResetSessionTimeoutWarning:function(){if(global.aliveInterval===0&&BAHWeb.Variables.UserLoggedIn&&!global.timeoutWindowOpen&&!global.timeoutWarningWindowOpen){window.clearTimeout(global.idleTimeoutId);var n=BAHWeb.Variables.UserSessionTimeout*6e4;global.idleTimeoutId=window.setTimeout($.proxy(global.ShowSessionTimeoutMessage,global),n);window.clearTimeout(global.idleWarningTimeoutId);global.idleWarningTimeoutId=window.setTimeout($.proxy(global.ShowSessionTimeoutWarning,global),n*.75)}},ShowSessionTimeoutWarning:function(){BAHWeb.Variables.JurisdictionId!=2?this.ShowTimeoutWarningDialog():gamingsvc.igamingservice.HasGameRounds($.proxy(this.CheckGameRoundsResponse,this))},CheckGameRoundsResponse:function(n){n?this.ResetSessionTimeoutWarning():this.ShowTimeoutWarningDialog()},ShowTimeoutWarningDialog:function(){global.timeoutWarningWindowOpen=!0;behaviors.ShowDialog({caption:BAHWeb.Translations.SessionTimeoutWarningHeadline,message:BAHWeb.Translations.SessionTimeoutWarningText,close:function(){window.location.reload()}})},ShowSessionTimeoutMessage:function(){global.timeoutWindowOpen=!0;behaviors.ShowDialog({caption:BAHWeb.Translations.SessionExpired,message:BAHWeb.Translations.SessionExpiredLoginAgain,close:function(){window.location.reload()}})},OnSessionTimeout:function(n){!BAHWeb.Variables.UserLoggedIn||global.timeoutWindowOpen||global.timeoutWarningWindowOpen||(global.timeoutWindowOpen=!0,behaviors.ShowDialog({caption:n[1],message:n[2],close:function(){window.location.reload()}}))},ReloadForMaintenance:function(){location.reload(!0)},OnBalanceUpdate:function(n){var r=!(navigator.appName=="Microsoft Internet Explorer"&&this._getInternetExplorerVersion()<=9),i=[window],t;for(this.IsOpenerSameDomain()&&(i[1]=window.opener),t=0;t<i.length;t++)if(i[t]&&i[t].global){if(n[1]=="False"){i[t].location.reload();return}i[t].global._UpdateBalance(".m-balanceCash",n[2],r);i[t].global._UpdateBalance(".m-balanceCashBonus",n[3],r);i[t].global._UpdateBalance(".m-balanceCashVoucher",n[4],r);i[t].global._UpdateBalance(".m-balanceCasino",n[5],r);i[t].global._UpdateBalance(".m-balanceCasinoBonus",n[6],r);i[t].global._UpdateBalance(".m-balanceCasinoCash",n[7],r);i[t].global._UpdateBalance(".m-balanceCasinoBonusRequirement",n[8],r);i[t].global._UpdateBalance(".m-balanceCasinoBonusWagered",n[9],r);i[t].global._UpdateBalance(".m-balanceGames",n[10],r);i[t].global._UpdateBalance(".m-balanceLiveCasino",n[11],r);i[t].global._UpdateBalance(".m-balancePoker",n[12],r)}},_UpdateBalance:function(n,t,i){$.each($(n),function(){$(this).text(t);i===!0&&$(this).effect("pulsate",{times:1},1e3)})},_getInternetExplorerVersion:function(){var t=-1,n=navigator.userAgent,i,r,u;return n&&(i=new RegExp("Trident/([0-9]{1,}[\\.0-9]{0,})"),i.exec(n)&&parseFloat(RegExp.$1)>=7&&(r=new RegExp("rv:([0-9]{1,}[\\.0-9]{0,})"),r.exec(n)))?parseFloat(RegExp.$1):(navigator.appName=="Microsoft Internet Explorer"&&(u=new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"),u.exec(n)&&(t=parseFloat(RegExp.$1))),t)},OnSwfObjectCreated:function(n){global.flashReferences[n.id]=n.ref},EmbedSwfObject:function(n){var t=n.FlashId;$("#"+t+"_1").length&&swfobject&&swfobject.embedSWF(n.SwfUrl,t+"_1",n.FlashWidth,n.FlashHeight,n.FlashVersion,n.ExpressInstallSwfUrl,n.FlashVars,n.FlashParams,n.FlashAttributes,this.OnSwfObjectCreated);swfobject&&swfobject.embedSWF(n.SwfUrl,t,n.FlashWidth,n.FlashHeight,n.FlashVersion,BAHWeb.Variables.BaseUrl+"/static/flash/expressinstall.swf",n.FlashVars,n.FlashParams,n.FlashAttributes,this.OnSwfObjectCreated)},ShowFlashPlayerWarning:function(n){swfobject&&!swfobject.hasFlashPlayerVersion(n)&&behaviors.ShowDialog({caption:BAHWeb.Translations.MessageBoxFlashWarningCaption,message:BAHWeb.Translations.MessageBoxFlashWarningText})},RefreshBalance:function(n){global.PreventDefault(n);$.ajax({type:"POST",url:BAHWeb.Variables.BaseUrl+"/ajax/balance"})},RefreshCasinoGameBalance:function(){this._ReloadCasinoGameBalance();this.IsOpenerSameDomain()&&window.opener.global&&window.opener.global._ReloadCasinoGameBalance()},_ReloadCasinoGameBalance:function(){var n=$("object[id$='_swf']",$("div.m-casinoGame"));n&&$.each(n,function(){typeof this.reloadbalance=="function"&&this.reloadbalance()})},StopPropagation:function(n){return n&&n.stopPropagation?n.stopPropagation():window.event?window.event.cancelBubble=!0:!1},PreventDefault:function(n){n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},UnsubscribeNewsletter:function(n,t){var i=$("#MessageBox"),r;$(i).toggleClass("loadingAnimation",!0);r=iusersvc.iuserservice;r.UnsubscribeNewsletter(n,t,function(n){$(i).toggleClass("loadingAnimation",!1);$(".m-msgCaption",i).text(n.Caption);$(".m-msgText",i).html(n.Message);$(".btn-text",i).text(n.ButtonText);$(".btn",i).prop("onclick",null).attr("onclick",null).unbind("click").click(function(){window.location.replace(BAHWeb.Variables.BaseUrlLng)})})},GetGameWindowDimesions:function(n,t){var i=n+this._gamingWinFrameWidth,r=t+this._gamingWinFrameHeight,u=(screen.width-i)/2,f=(screen.height-r)/2;return{gameWidth:n,gameHeight:t,winWidth:i,winHeight:r,yPos:f,xPos:u}},OpenGameWindow:function(n,t,i,r,u){var s;global.PreventDefault(n);r=r<640?640:r;u=u<480?480:u;var f=this.GetGameWindowDimesions(r,u),h="toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width="+f.winWidth+",height="+f.winHeight+",screenx="+f.xPos+",screeny="+f.yPos+",left="+f.xPos+",top="+f.yPos,o=this.IsOpenerSameDomain(),e=o?window:this._popup;e&&!e.closed&&this.ResizeGameWindow(e,f);s=o?window.opener:window;this._popupWindow=s.open(t,i,h);this._popupWindow&&this._popupWindow.focus();window.setTimeout(function(){(!global._popupWindow||global._popupWindow.closed||parseInt(global._popupWindow.outerWidth,10)===0)&&(global._popupWindow&&global._popupWindow.close(),(behaviors.IsBrowserSafari||behaviors.IsBrowserChrome)&&behaviors.ShowDialog({caption:"",message:BAHWeb.Translations.SafariPopupDenied,close:null,buttonText:"",onButtonClick:null}))},500)},ResizeGameWindow:function(n,t){var i=0,r=0,u,f;try{i=$(n).width();r=$(n).height()}catch(e){}n.moveTo(t.xPos,t.yPos);u=t.winWidth-i;f=t.winHeight-r;n.resizeBy(u,f)},OpenResizeableWindow:function(n,t,i,r){var f=(screen.width-i)/2,e=(screen.height-r)/2,o="width="+i+",height="+r+",location=1,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,hotkeys=0,screenx="+f+",screeny="+e+",left="+f+",top="+e,u=window.open(n,t,o);if(u)return u.focus(),u},OpenFixedWindow:function(n,t,i,r){var u=(screen.width-i)/2,f=(screen.height-r)/2,e="width="+i+",height="+r+",location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,hotkeys=0,screenx="+u+",screeny="+f+",left="+u+",top="+f,o=window.open(n,t,e);o.focus()},TermsAndConditionsChangesAccepted:function(){if($("#cbAcceptTermsAndConditions").prop("checked")){var n=iusersvc.iuserservice;n.TermsAndConditionsChangesAccepted(function(){window.location.reload()},function(){$("#termsAndConditionsAcceptanceNecessaryContent").toggleClass("s-hidden",!0);$("#termsAndConditionsAcceptanceNecessaryError").toggleClass("s-hidden",!1)})}else $("#ebAGB").toggleClass("s-hidden",!1)},GetMobileUrl:function(n){return BAHWeb.Variables.BaseUrl+"/mobile"+n.replace(BAHWeb.Variables.BaseUrl,"")}};global=new BAHWeb.Global;$(document).ready(function(){global.Init()});BAHWeb.General=BAHWeb.General||{};BAHWeb.General.Behaviors=function(){};BAHWeb.General.Behaviors.prototype={Init:function(){this.InitBahClock();this.BindBehaviors();this.InitTabulator();this.InitAccordion();this.InitSlider();this.InitLexicon();this.EnableRadioButtonHighlighting();this.InitCmsPreview();this.InitAutoFocus();this.InitCssTransforms()},InitBahClock:function(){this.bahClock=$("#globalClock");this.loggedInTimer=$("#globalLoggedInTimer");this.loggedInTimer.length>0&&(global.loginTime=Date.parseInvariant(this.loggedInTimer.data("time"),"yyyy-MM-dd HH:mm:ss"),this.elapsedLoginTime=Date.parseInvariant(this.loggedInTimer.data("time"),"yyyy-MM-dd HH:mm:ss"),this.loggedInTimer.removeData("time"));this.bahClock.length>0&&(global.bahTime=Date.parseInvariant(this.bahClock.data("time"),"yyyy-MM-dd HH:mm:ss"),this.bahClock.removeData("time"),behaviors.RefreshClock(),window.setInterval(behaviors.RefreshClock,1e3))},InitTabulator:function(){$("div.m-tabs").each(function(){$(this).tabs()})},InitAccordion:function(){$("div.m-accordion").each(function(){$(this).accordion({active:!1,collapsible:!0,heightStyle:"content"})})},InitLexicon:function(){$("div.m-lexicon").each(function(){$(this).glossary()})},InitSlider:function(n){var t=500,i="fade";n=n===undefined?"div.m-slider":n+".m-slider";$(n).each(function(){var u=$(this),p=u.attr("data-autorotate")=="true",w=parseInt(u.attr("data-pause"),10),b=parseInt(u.attr("data-fixedHeight"),10),k=u.attr("data-startSlide"),n=$("ul.sli:first",u),e=$(">li.sli-item",n),v,s,f,c,l,h,r,d,a;if(e.length===0){$(this).toggleClass("s-hidden",!0);return}if(v=0,k!=="")for(s=0;s<e.length;s++)if($(e[s]).attr("class").indexOf(k)>=0){v=s;break}if(n.slides=e,n.slideCnt=$("span.ste-content",u),f="",c=n.parent().width(),!n.parent().is(":visible")&&c===0){for(l=n.parents(),h=0;h<l.length&&!$(l[h]).is(":visible");)f=l[h].id,h++;$("#"+f).show();c=n.parent().width();$("#"+f).hide()}if(n.width(c),n.slides.width(n.width()),e.css("position","absolute"),r=0,u.attr("id")=="sliTopBets"){$("#sliTopBets ul li").css("display","list-item");var o=$("#sliTopBets ul li div"),g=o.innerHeight()-o.height(),y=0;o.each(function(){var n=$(this).height(),t;$(this).is(":visible")||n!==0||($("#"+f).show(),n=$(this).height(),$("#"+f).hide());r=Math.max(r,n);t=$(this).find("h1").height();y=Math.max(y,t)});d=o.find("h1");d.each(function(){$(this).height(y)});$("#sliTopBets ul li").css("display","");o.height(r);r=r*Math.min(2,o.length-1)+3+g*Math.min(2,o.length-1)}else $.each(e,function(){var n=$(this).height();$(this).is(":visible")||n!==0||($("#"+f).show(),n=$(this).height(),$("#"+f).hide());r=Math.max(r,n)});if(b>0?n.height(b):(n.height(r),$("img",n).load(function(){$.each(e,function(){r=Math.max(r,$(this).height())});n.height(r)})),n.OnHover=!1,n.slides.length>0){a=$(".m-sliderNav:first",u);a.toggleClass("s-hidden",n.slides.length<2);n.slides.length>1?(n.OnSlideCbk=function(r){window.clearTimeout(n.timeoutId);$(n.slides[n.index]).hide(i,{direction:"left",easing:"easeInOutExpo"},t).toggleClass("s-active",!1);n.index=r>-1?r:n.index==n.slides.length-1?0:n.index+1;$(n.slides[n.index]).show(i,{direction:"right",easing:"easeInOutExpo"},t).toggleClass("s-active",!0);n.slideCnt.text(n.index+1+"/"+n.slides.length);p&&!n.OnHover&&(n.timeoutId=window.setTimeout(n.OnSlideCbk,w,-1))},u.hover(function(){n.OnHover=!0;window.clearTimeout(n.timeoutId)},function(){n.OnHover=!1;p&&(n.timeoutId=window.setTimeout(n.OnSlideCbk,w,-1))}),$(".m-prevBtn",a).bind("click",function(){window.clearTimeout(n.timeoutId);var t=n.index===0?n.slides.length-1:n.index-1;n.OnSlideCbk(t)}),$(".m-nextBtn",a).bind("click",function(){window.clearTimeout(n.timeoutId);var t=n.index==n.slides.length-1?0:n.index+1;n.OnSlideCbk(t)}),n.OnSlideCbk(v)):($(n.slides[0]).show(),$(n.slides[0]).toggleClass("s-active",!0));return}$(this).hide()})},InitCmsPreview:function(){$(".m-isPreview").toggleClass("s-preview",!0);$(".m-isPreview").find("*").each(function(){$(this).toggleClass("s-preview",!0)})},RefreshClock:function(){global.bahTime.setTime(global.bahTime.getTime()+1e3);behaviors.bahClock.text(global.bahTime.format("HH:mm:ss"));behaviors.loggedInTimer.length&&(behaviors.elapsedLoginTime.setTime(global.bahTime.getTime()-global.loginTime.getTime()),behaviors.loggedInTimer.text(behaviors.elapsedLoginTime.getUTCHours()+":"+behaviors.elapsedLoginTime.format("mm:ss")))},BindBehaviors:function(){this.BindContentMenuBehavior();this.BindLangSelectionBehavior();this.BindTextInputBehavior();this.BindUpperCaseInputBehavior();this.BindAmountInputBehavior();this.BindTooltipBehavior();this.BindTooltipDelayLongBehavior();this.BindLoadingBehavior()},BindLoadingBehavior:function(){},BindTooltipBehavior:function(){if(!BAHWeb.Variables.IsMobileDevice){var n=global._getInternetExplorerVersion();(!$.fx.off||n>=9)&&$.ui.tooltip&&($(document).tooltip({content:function(){return behaviors.GetTitleForTooltip(this)},hide:!1,show:{delay:300}}).off("focusin focusout"),typeof casino!="undefined"&&casino._InitCasinoGameMatrixTooltips())}},BindTooltipDelayLongBehavior:function(){var n=global._getInternetExplorerVersion();(!$.fx.off||n>=9)&&$.ui.tooltip&&$(document).find("[data-tooltipdelaylong]").tooltip({content:function(){return behaviors.GetTitleForTooltip(this)},hide:!1,show:{delay:700}}).off("focusin focusout")},BindAmountInputBehavior:function(){$("input.amount").bind("focusout keypress",function(n){if(n.type=="focusout"||n.which==13){var i=$(this),t=i.val().replace(",",".");if(t.length===0||isNaN(t)||t.length>10){i.val("0.00");return}i.val(Math.abs(parseFloat(t)).toFixed(2))}}).focusin(function(){$(this).select()})},BindTextInputBehavior:function(){$("input.input-text, textarea.input-text").each(function(){$(this).siblings("span.input-text-placeholder").toggle($(this).val().length===0);$(this).bind("focusin",function(){$(this).siblings("span.input-text-placeholder").toggle(!1)});$(this).bind("input",function(){$(this).siblings("span.input-text-placeholder").toggle($(this).val().length===0)});$(this).bind("focusout",function(){$(this).siblings("span.input-text-placeholder").toggle($(this).val().length===0)})})},BindUpperCaseInputBehavior:function(){var n=$('input.m-toUpperCase[type="text"]');n.each(function(){$(this).keyup(function(n){$(this).val().length>0&&n.keyCode>=65&&n.keyCode<=90&&$(this).val($(this).val().toUpperCase())});var n=global._getInternetExplorerVersion();(n==-1||n<=9)&&$(this).bind("input",function(){$(this).val($(this).val().toUpperCase())})})},BindLangSelectionBehavior:function(){var n=$("#drdLangSelection");n.length!==0&&($(".drd-content-wrapper",n).bind("mouseleave",function(){n.toggleClass("s-expanded",!1)}),n.bind("click",function(){n.toggleClass("s-expanded")}))},BindContentMenuBehavior:function(){$("div.m-contentMenu").on("click","a.ftl-item-link, a.ftl-nestedItem-link, a.ftl-nestedSubItem-link",this.ContentMenuItemClick);$("ul",".m-contentMenu").each(function(){$(this).children().length===0&&$(this).parents(".m-contentMenuBlock").toggleClass("s-hidden",!0)})},ContentMenuItemClick:function(n){global.StopPropagation(n);behaviors.ToggleMenu(this);$(this).siblings("ul").length>0&&n.preventDefault()},ToggleMenu:function(n){$(n).parent().toggleClass("s-expanded",200);$(n).parent().toggleClass("m-expanded");BAHWeb.Variables.AllowJustOneItemExpanded&&$(n).parent().hasClass("m-expanded")&&$("div.m-contentMenuBlock").not($(n).closest("div.m-contentMenuBlock")).find("li.ftl-item").removeClass("s-expanded m-expanded");BAHWeb.Variables.ShowExpandedItemActive&&($("div.m-contentMenuBlock").removeClass("s-active"),$("li.ftl-item.m-expanded").closest("div.m-contentMenuBlock").addClass("s-active"))},OpenSupport:function(n,t){global.PreventDefault(n);var f=800,e=728,i=f>window.screen.availWidth?window.screen.availWidth-f:f,o=e>window.screen.availHeight?window.screen.availHeight-e:e,r=window.screen.availLeft?window.screen.availLeft+(window.screen.availWidth-i)/2:(window.screen.availWidth-i)/2,u=(window.screen.availHeight-o)/2;t?window.open(BAHWeb.Variables.BaseUrlLng+"/contact#"+t,"contactwindow","width="+i+",height="+o+",left="+r+",top="+u+",screenX="+r+",screenY="+u+",scrollbars,resizable").focus():window.open(BAHWeb.Variables.BaseUrlLng+"/contact","contactwindow","width="+i+",height="+o+",left="+r+",top="+u+",screenX="+r+",screenY="+u+",scrollbars,resizable").focus()},ResponsibleGamingDialogStart:function(){window.setTimeout(behaviors.ResponsibleGamingDialogStep2,3e4)},ResponsibleGamingDialogStep2:function(){var n=$("#ResponsibleGamingBox");$("#step1",n).toggleClass("s-hidden",!0);$("#step2",n).toggleClass("s-hidden",!1);$(".btn-text",n).toggleClass("s-invisible",!1);$(".btn-text",n).removeProp("onclick");$(".btn-text",n).bind("click",behaviors.ResponsibleGamingDialogStep3)},ResponsibleGamingDialogStep3:function(){var n=$("#ResponsibleGamingBox");$("#step2",n).toggleClass("s-hidden",!0);$("#step3",n).toggleClass("s-hidden",!1);$(".btn-text",n).toggleClass("s-hidden",!0);window.setTimeout(behaviors.ResponsibleGamingDialogShowClose,3e4)},ResponsibleGamingDialogShowClose:function(){$(".ui-dialog-titlebar-close").show();$(".ui-widget-overlay").click(function(){$("#ResponsibleGamingBox").dialog("close")})},SetPlatformCookie:function(n,t){var i=new Date;i.setDate(i.getDate()+7);document.cookie=n+"="+t+"; expires="+i.toUTCString()+"; path=/"},DeletePlatformCookie:function(n){var t=new Date;t.setDate(t.getDate()-1);document.cookie=n+"=; expires="+t.toUTCString()+"; path=/"},SwitchPlatform:function(n,t,i){behaviors.SetPlatformCookie(n,t);behaviors.CloseDialog(this,"MessageDialogMobile");i.length>0&&window.open(i,"_self",!0)},SetLinkToMobileHref:function(n,t){var i=$("#LinkToMobileAnchor").attr("href");(t||typeof i=="undefined")&&$("#LinkToMobileAnchor").attr("href",n)},ShowDialog:function(n){var i,r,f,u,t;n.id=typeof n.id!="undefined"?n.id:"MessageBox";$(".ui-dialog-content").dialog("isOpen")===!0&&(i=$(".ui-dialog-content"),n.id===i.attr("id")?(r=$("#"+n.id),$(".btn-text",r).unbind("click"),$(".ui-widget-overlay").unbind("click"),f=$(".btn-text",i).attr("onClick"),$(".btn-text",r).bind("click",function(){var n=new Function("event",f);n()})):i.dialog("destroy"));n.showCloseButton=typeof n.showCloseButton!="undefined"?n.showCloseButton:!0;n.isModal=typeof n.isModal!="undefined"?n.isModal:!0;n.minHeight=typeof n.minHeight!="undefined"?n.minHeight:0;n.buttonText=typeof n.buttonText!="undefined"?n.buttonText:n.id!="MessageBox"?undefined:BAHWeb.Translations.Ok;n.showButton=typeof n.showButton!="undefined"?n.showButton:!0;n.width=typeof n.width!="undefined"?n.width:440;u=$("#"+n.id);t=$("#"+n.id+"DialogMessageContent");n.showCloseButton===!1?$(".ui-dialog-titlebar-close").hide():$(".ui-dialog-titlebar-close").show();typeof n.caption!="undefined"&&n.caption!==null&&n.caption.length!==0&&$(".m-msgCaption",t).html(n.caption);typeof n.message!="undefined"&&n.message!==null&&n.message.length!==0&&$(".m-msgText",t).html(n.message);typeof n.buttonText!="undefined"&&n.buttonText!==null&&n.buttonText.length!==0&&$(".btn-text",t).text(n.buttonText);$(".btn-text",t).toggleClass("s-hidden",!n.showButton);typeof n.onButtonClick!="undefined"&&n.onButtonClick!==null&&$(".btn",t).prop("onclick",null).attr("onclick",null).unbind("click").click(n.onButtonClick);u.attr("title",n.title);u.dialog({modal:n.isModal,width:n.width,minHeight:n.minHeight,resizable:!1,draggable:!1,open:function(){$(this).parent().appendTo("form");n.showCloseButton===!1?$(".ui-dialog-titlebar-close").hide():$(".ui-dialog-titlebar-close").show()},close:n.close,closeOnEscape:n.showCloseButton,closeText:""}).height("auto")},CloseDialog:function(n,t){global.PreventDefault(n);$("#"+t).dialog("close")},EvaluateAddictionTest:function(){var n=0,t=!1;($("[type=radio]:checked",$(".m-question")).each(function(){n+=$(this).val()-0}),$("input:radio:checked").length!=$(".m-question").length&&(t=!0),$("#EvaluationError").toggleClass("s-hidden",!t),t)||(n===0?$("#TestResult_NoRisk").show():n<=2?$("#TestResult_LowRisk").show():n<=7?$("#TestResult_ModRisk").show():$("#TestResult_Problem").show(),$("#EvaluationButton").hide(),$("#TestResult").show(),$("#ResetButton").removeClass("s-disabled"),$("#ResetButton").toggleClass("s-hidden",!1))},TestReset:function(){$("[type=radio]",$(".m-question")).attr("checked",!1);$("#EvaluationButton").show();$("#TestResult").hide();$("#ResetButton").toggleClass("s-hidden",!0);$("#TestResult > td > h2").hide()},DetectClientCapabilities:function(){if(!BAHWeb.Variables.UserLoggedIn){var n=swfobject?swfobject.getFlashPlayerVersion():null;$("#FlashPlayerVersion").val(swfobject?n.major+"."+n.minor+"."+n.release:"");$("#ClientScreenWidth").val(screen.width);$("#ClientScreenHeight").val(screen.height)}},WinnerListSelection:function(n,t,i){global.PreventDefault(n);$("#WinnerListHeader").toggleClass("s-loading",!0);$.ajax({url:String.format("{0}/{1}/{2}",t,BAHWeb.Variables.Channel,i),context:this,success:this._OnWinnerListContentRecieved,error:this._OnWinnerListContentError})},ShowSportWinnerDetails:function(n,t){global.PreventDefault(n);$.ajax({url:t,context:this,success:function(n){$("#dialog").empty().dialog({width:700,modal:!0,position:{my:"top",at:"top+200"},closeText:""}).append(n)}})},_OnWinnerListContentRecieved:function(n){$("#WinnerListHeader").toggleClass("s-loading",!1);$("#WinnerListContent").replaceWith($("#WinnerListContent",n))},_OnWinnerListContentError:function(){$("#WinnerListHeader").toggleClass("s-loading",!1);$("#WinnerListContent").html(String.format("<span>{0}<\/span>",BAHWeb.Translations.AjaxCallFailed))},CountryCodeAutoChoose:function(){var n=$("select[id*=drpCountry]")[0],t=$("select[id*=MobileCountryCode_drpList]");n&&t&&BAHWeb.Variables.IsUserMigration!==!0&&(n.selectedIndex>0?t.prop("selectedIndex",n.selectedIndex-1):t.val("43"))},CurrencyAutoChoose:function(){var t=$("select[id*=drpCountry]")[0],n=$("select[id*=drpCurrency]")[0];if(t&&n&&BAHWeb.Variables.IsUserMigration!==!0)switch(BAHWeb.Variables.Lang.toUpperCase()){case"PL":n.selectedIndex=6;break;case"SV":n.selectedIndex=11;break;case"CS":n.selectedIndex=7;break;case"DA":n.selectedIndex=5;break;default:if(t.value!=-1)switch(t.value){case"152":case"19":case"75":case"68":case"94":n.selectedIndex=1;break;case"193":n.selectedIndex=2;break;case"211":n.selectedIndex=3;break;case"212":n.selectedIndex=4;break;case"53":n.selectedIndex=5;break;case"161":n.selectedIndex=6;break;case"52":n.selectedIndex=7;break;case"30":n.selectedIndex=8;break;case"167":n.selectedIndex=9;break;case"166":n.selectedIndex=10;break;case"192":n.selectedIndex=11;break;default:n.selectedIndex=1}else n.selectedIndex=1}},GetTitleForTooltip:function(n){return $("<div>").html($(n).attr("title")||"").html()},IsBrowserSafari:Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,IsBrowserChrome:navigator.userAgent.toLowerCase().indexOf("chrome")>-1,EnableRadioButtonHighlighting:function(){var n=$(":radio",$(".m-radiogroup"));n.length>0&&$(":checked",$(".m-radiogroup")).length===0&&$(":radio:last",$(".m-radiogroup")).attr("checked","checked");n.each(function(){$(this).is(":checked")&&$(this).parents("tr").addClass("s-emphasized");$(this).change(function(){$(this).parents("tr").siblings().removeClass("s-emphasized");$(this).parents("tr").addClass("s-emphasized")})})},InitAutoFocus:function(){$("input.m-focusOnLoad").first().focus()},InitCssTransforms:function(){var n=document.documentElement.style;("transform"in n||"webkitTransform"in n||"mozTransform"in n||"msTransform"in n||"oTransform"in n)&&(document.documentElement.className+=" csstransforms")}};$.widget("bah.counter",{privateMembers:{digitsToInsert:null,decimalsToInsert:null,digits:null,decimals:null,decpoint:null,commapoint:null,couItemAnim:null,couItemsWrapper:null},options:{amount:"0.00",easing:"easeOutBounce",currency:"EUR",intervalStart:3e3,intervalEnd:5e3},_create:function(){jQuery.support.opacity||(jQuery.fx.off=!0);this.privateMembers.digitsToInsert=$(".cou-items-dig",this.element);this.privateMembers.decimalsToInsert=$(".cou-items-dec",this.element);this.privateMembers.couItemsWrapper=$(".cou-items-wrapper",this.element);this._addDigits();this._update()},_setOption:function(n,t){this.options[n]=t;this._create()},_getDigits:function(n){var t=n.split(".");return t[0]},_getDecimals:function(n){var t=n.split(".");return t[1]},_getRandomInt:function(n,t){return Math.floor(Math.random()*(t-n+1))+n},_getAnimationSpan:function(n){for(var t,r="<span class='cou-item cou-item-anim'><ul>",u=this._getRandomInt(0,9),f=parseInt(n,10),i=u;i<11;i++)t=f+i,t>=10&&(t-=10),r+="<li>"+t+"<\/li>";return r+"<\/span><\/ul>"},_removeContent:function(){this.privateMembers.digits=$(".cou-item-dig",this.element);this.privateMembers.decimals=$(".cou-item-dec",this.element);this.privateMembers.decpoint=$(".cou-item-decpoint",this.element);this.privateMembers.commapoint=$(".cou-item-commapoint",this.element);this.privateMembers.digits.remove();this.privateMembers.decimals.remove();this.privateMembers.decpoint.remove();this.privateMembers.commapoint.remove()},_addCommas:function(n){return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},_addDigits:function(){var f,n,t,i,s,r,e,u,o,h;for(this._removeContent(),f=this._addCommas(this._getDigits(this.options.amount)),n="",t=0;t<f.length;t++)i=f.charAt(t),i!==","?(s=this._getAnimationSpan(i),n+='<li class="cou-item cou-item-dig">'+i+s+"<\/li>"):n+='<li class="cou-item cou-item-commapoint">,<\/li>';for(n+='<li class="cou-item cou-item-decpoint">.<\/li>',r="",e=this._getDecimals(this.options.amount),u=0;u<e.length;u++)o=e.charAt(u),h=this._getAnimationSpan(o),r+='<li class="cou-item cou-item-dec">'+o+h+"<\/li>";r+='<li class="cou-item-currency">'+this.options.currency+"<\/li>";this.privateMembers.digitsToInsert.html(n);this.privateMembers.decimalsToInsert.html(r)},_animateDigits:function(n){for(var i,t=0;t<n.length;t++)i=$(n[t]),i.hide().fadeIn(300).animate({top:-i.height()+i.parent().height()},{duration:this._getRandomInt(this.options.intervalStart,this.options.intervalEnd),specialEasing:{top:this.options.easing}})},_update:function(){this.privateMembers.couItemAnim=$(".cou-item-anim",this.element);this._animateDigits(this.privateMembers.couItemAnim)}});behaviors=new BAHWeb.General.Behaviors;$(document).ready(function(){behaviors.Init()});BAHWeb.Promotion=BAHWeb.Promotion||{};BAHWeb.Promotion.PromotionBehavior=function(){};BAHWeb.Promotion.PromotionBehavior.prototype={Init:function(){this.InitCrazyRoadToBerlin()},InitCrazyRoadToBerlin:function(){$(document).ready(function(){$("#crazyRoadMilestones").on("click",function(){if($(".crazy__waypoint").hasClass("a-position")){$(".crazy__waypoint").removeClass("a-position");$(".crazy__waypoint").addClass("a-position",100);return}$(".crazy__waypoint").addClass("a-position")})})}};PromotionBehavior=null;$(document).ready(function(){PromotionBehavior=new BAHWeb.Promotion.PromotionBehavior;PromotionBehavior.Init()});Type.registerNamespace("iusersvc");iusersvc.iuserservice=function(){iusersvc.iuserservice.initializeBase(this);this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null};iusersvc.iuserservice.prototype={_get_path:function(){var n=this.get_path();return n?n:iusersvc.iuserservice._staticInstance.get_path()},Logout:function(n,t,i){return this._invoke(this._get_path(),"Logout",!1,{},n,t,i)},UnsubscribeNewsletter:function(n,t,i,r,u){return this._invoke(this._get_path(),"UnsubscribeNewsletter",!1,{accountNr:n,email:t},i,r,u)},ResponsibleGamingStop:function(n,t,i){return this._invoke(this._get_path(),"ResponsibleGamingStop",!1,{},n,t,i)},ContractAccepted:function(n,t,i){return this._invoke(this._get_path(),"ContractAccepted",!1,{},n,t,i)},ChangeExpiredPassword:function(n,t,i,r,u){return this._invoke(this._get_path(),"ChangeExpiredPassword",!1,{newPassword:n,oldPassword:t},i,r,u)},TermsAndConditionsChangesAccepted:function(n,t,i){return this._invoke(this._get_path(),"TermsAndConditionsChangesAccepted",!1,{},n,t,i)},FundsProtectionAccepted:function(n,t,i){return this._invoke(this._get_path(),"FundsProtectionAccepted",!1,{},n,t,i)}};iusersvc.iuserservice.registerClass("iusersvc.iuserservice",Sys.Net.WebServiceProxy);iusersvc.iuserservice._staticInstance=new iusersvc.iuserservice;iusersvc.iuserservice.set_path=function(n){iusersvc.iuserservice._staticInstance.set_path(n)};iusersvc.iuserservice.get_path=function(){return iusersvc.iuserservice._staticInstance.get_path()};iusersvc.iuserservice.set_timeout=function(n){iusersvc.iuserservice._staticInstance.set_timeout(n)};iusersvc.iuserservice.get_timeout=function(){return iusersvc.iuserservice._staticInstance.get_timeout()};iusersvc.iuserservice.set_defaultUserContext=function(n){iusersvc.iuserservice._staticInstance.set_defaultUserContext(n)};iusersvc.iuserservice.get_defaultUserContext=function(){return iusersvc.iuserservice._staticInstance.get_defaultUserContext()};iusersvc.iuserservice.set_defaultSucceededCallback=function(n){iusersvc.iuserservice._staticInstance.set_defaultSucceededCallback(n)};iusersvc.iuserservice.get_defaultSucceededCallback=function(){return iusersvc.iuserservice._staticInstance.get_defaultSucceededCallback()};iusersvc.iuserservice.set_defaultFailedCallback=function(n){iusersvc.iuserservice._staticInstance.set_defaultFailedCallback(n)};iusersvc.iuserservice.get_defaultFailedCallback=function(){return iusersvc.iuserservice._staticInstance.get_defaultFailedCallback()};iusersvc.iuserservice.set_enableJsonp=function(n){iusersvc.iuserservice._staticInstance.set_enableJsonp(n)};iusersvc.iuserservice.get_enableJsonp=function(){return iusersvc.iuserservice._staticInstance.get_enableJsonp()};iusersvc.iuserservice.set_jsonpCallbackParameter=function(n){iusersvc.iuserservice._staticInstance.set_jsonpCallbackParameter(n)};iusersvc.iuserservice.get_jsonpCallbackParameter=function(){return iusersvc.iuserservice._staticInstance.get_jsonpCallbackParameter()};iusersvc.iuserservice.set_path(BAHWeb.Variables.BaseUrl+"/svc/user");iusersvc.iuserservice.Logout=function(n,t,i){iusersvc.iuserservice._staticInstance.Logout(n,t,i)};iusersvc.iuserservice.UnsubscribeNewsletter=function(n,t,i,r,u){iusersvc.iuserservice._staticInstance.UnsubscribeNewsletter(n,t,i,r,u)};iusersvc.iuserservice.ResponsibleGamingStop=function(n,t,i){iusersvc.iuserservice._staticInstance.ResponsibleGamingStop(n,t,i)};iusersvc.iuserservice.ContractAccepted=function(n,t,i){iusersvc.iuserservice._staticInstance.ContractAccepted(n,t,i)};iusersvc.iuserservice.ChangeExpiredPassword=function(n,t,i,r,u){iusersvc.iuserservice._staticInstance.ChangeExpiredPassword(n,t,i,r,u)};iusersvc.iuserservice.TermsAndConditionsChangesAccepted=function(n,t,i){iusersvc.iuserservice._staticInstance.TermsAndConditionsChangesAccepted(n,t,i)};iusersvc.iuserservice.FundsProtectionAccepted=function(n,t,i){iusersvc.iuserservice._staticInstance.FundsProtectionAccepted(n,t,i)};gtc=Sys.Net.WebServiceProxy._generateTypedConstructor;Type.registerNamespace("BAHWeb.App.Services");typeof BAHWeb.App.Services.SvcResponseOfanyType=="undefined"&&(BAHWeb.App.Services.SvcResponseOfanyType=gtc("SvcResponseOfanyType:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.SvcResponseOfanyType.registerClass("BAHWeb.App.Services.SvcResponseOfanyType"));typeof BAHWeb.App.Services.UserState=="undefined"&&(BAHWeb.App.Services.UserState=gtc("UserState:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.UserState.registerClass("BAHWeb.App.Services.UserState"));typeof BAHWeb.App.Services.AuthenticationState=="undefined"&&(BAHWeb.App.Services.AuthenticationState=gtc("AuthenticationState:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.AuthenticationState.registerClass("BAHWeb.App.Services.AuthenticationState"));typeof BAHWeb.App.Services.Event=="undefined"&&(BAHWeb.App.Services.Event=gtc("Event:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.Event.registerClass("BAHWeb.App.Services.Event"));typeof BAHWeb.App.Services.Bet=="undefined"&&(BAHWeb.App.Services.Bet=gtc("Bet:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.Bet.registerClass("BAHWeb.App.Services.Bet"));typeof BAHWeb.App.Services.Participant=="undefined"&&(BAHWeb.App.Services.Participant=gtc("Participant:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.Participant.registerClass("BAHWeb.App.Services.Participant"));typeof BAHWeb.App.Services.BalanceTransferResponse=="undefined"&&(BAHWeb.App.Services.BalanceTransferResponse=gtc("BalanceTransferResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.BalanceTransferResponse.registerClass("BAHWeb.App.Services.BalanceTransferResponse"));typeof BAHWeb.App.Services.BonusCodeTranslationResponse=="undefined"&&(BAHWeb.App.Services.BonusCodeTranslationResponse=gtc("BonusCodeTranslationResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.BonusCodeTranslationResponse.registerClass("BAHWeb.App.Services.BonusCodeTranslationResponse"));typeof BAHWeb.App.Services.BonusPromotionData=="undefined"&&(BAHWeb.App.Services.BonusPromotionData=gtc("BonusPromotionData:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.BonusPromotionData.registerClass("BAHWeb.App.Services.BonusPromotionData"));typeof BAHWeb.App.Services.MySportBetsResponse=="undefined"&&(BAHWeb.App.Services.MySportBetsResponse=gtc("MySportBetsResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.MySportBetsResponse.registerClass("BAHWeb.App.Services.MySportBetsResponse"));typeof BAHWeb.App.Services.SportOrder=="undefined"&&(BAHWeb.App.Services.SportOrder=gtc("SportOrder:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.SportOrder.registerClass("BAHWeb.App.Services.SportOrder"));typeof BAHWeb.App.Services.SportOrderPosition=="undefined"&&(BAHWeb.App.Services.SportOrderPosition=gtc("SportOrderPosition:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.SportOrderPosition.registerClass("BAHWeb.App.Services.SportOrderPosition"));typeof BAHWeb.App.Services.PaymentResponse=="undefined"&&(BAHWeb.App.Services.PaymentResponse=gtc("PaymentResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.PaymentResponse.registerClass("BAHWeb.App.Services.PaymentResponse"));typeof BAHWeb.App.Services.LastDepositResponse=="undefined"&&(BAHWeb.App.Services.LastDepositResponse=gtc("LastDepositResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.LastDepositResponse.registerClass("BAHWeb.App.Services.LastDepositResponse"));typeof BAHWeb.App.Services.PulicBonusCodeResponse=="undefined"&&(BAHWeb.App.Services.PulicBonusCodeResponse=gtc("PulicBonusCodeResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services"),BAHWeb.App.Services.PulicBonusCodeResponse.registerClass("BAHWeb.App.Services.PulicBonusCodeResponse"));Type.registerNamespace("BAHWeb.App.Core.Services");typeof BAHWeb.App.Core.Services.SvcCoreResponseOfUserStateE44E8JjY=="undefined"&&(BAHWeb.App.Core.Services.SvcCoreResponseOfUserStateE44E8JjY=gtc("SvcCoreResponseOfUserStateE44E8JjY:http://schemas.datacontract.org/2004/07/BAHWeb.App.Core.Services"),BAHWeb.App.Core.Services.SvcCoreResponseOfUserStateE44E8JjY.registerClass("BAHWeb.App.Core.Services.SvcCoreResponseOfUserStateE44E8JjY"));typeof BAHWeb.App.Core.Services.UserState=="undefined"&&(BAHWeb.App.Core.Services.UserState=gtc("UserState:http://schemas.datacontract.org/2004/07/BAHWeb.App.Core.Services"),BAHWeb.App.Core.Services.UserState.registerClass("BAHWeb.App.Core.Services.UserState"));typeof BAHWeb.App.Core.Services.RecoverPasswordResponse=="undefined"&&(BAHWeb.App.Core.Services.RecoverPasswordResponse=gtc("RecoverPasswordResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Core.Services"),BAHWeb.App.Core.Services.RecoverPasswordResponse.registerClass("BAHWeb.App.Core.Services.RecoverPasswordResponse"));typeof BAHWeb.App.Core.Services.AccountOptions=="undefined"&&(BAHWeb.App.Core.Services.AccountOptions=gtc("AccountOptions:http://schemas.datacontract.org/2004/07/BAHWeb.App.Core.Services"),BAHWeb.App.Core.Services.AccountOptions.registerClass("BAHWeb.App.Core.Services.AccountOptions"));Type.registerNamespace("BAHWeb.Common.Classes.General");typeof BAHWeb.Common.Classes.General.LandingpageInformation=="undefined"&&(BAHWeb.Common.Classes.General.LandingpageInformation=gtc("LandingpageInformation:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.General"),BAHWeb.Common.Classes.General.LandingpageInformation.registerClass("BAHWeb.Common.Classes.General.LandingpageInformation"));Type.registerNamespace("BAHWeb.Common.Classes.Account");typeof BAHWeb.Common.Classes.Account.RegistrationItem=="undefined"&&(BAHWeb.Common.Classes.Account.RegistrationItem=gtc("RegistrationItem:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.Account"),BAHWeb.Common.Classes.Account.RegistrationItem.registerClass("BAHWeb.Common.Classes.Account.RegistrationItem"));Type.registerNamespace("BAHWeb.Common.Classes.Sport");typeof BAHWeb.Common.Classes.Sport.SportItem=="undefined"&&(BAHWeb.Common.Classes.Sport.SportItem=gtc("SportItem:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.Sport"),BAHWeb.Common.Classes.Sport.SportItem.registerClass("BAHWeb.Common.Classes.Sport.SportItem"));typeof BAHWeb.Common.Classes.Sport.RegionItem=="undefined"&&(BAHWeb.Common.Classes.Sport.RegionItem=gtc("RegionItem:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.Sport"),BAHWeb.Common.Classes.Sport.RegionItem.registerClass("BAHWeb.Common.Classes.Sport.RegionItem"));typeof BAHWeb.Common.Classes.Sport.EventGroupItem=="undefined"&&(BAHWeb.Common.Classes.Sport.EventGroupItem=gtc("EventGroupItem:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.Sport"),BAHWeb.Common.Classes.Sport.EventGroupItem.registerClass("BAHWeb.Common.Classes.Sport.EventGroupItem"));typeof BAHWeb.Common.Classes.Sport.FilteredBetItem=="undefined"&&(BAHWeb.Common.Classes.Sport.FilteredBetItem=gtc("FilteredBetItem:http://schemas.datacontract.org/2004/07/BAHWeb.Common.Classes.Sport"),BAHWeb.Common.Classes.Sport.FilteredBetItem.registerClass("BAHWeb.Common.Classes.Sport.FilteredBetItem"));Type.registerNamespace("BAHWeb.App.Services.Casino");typeof BAHWeb.App.Services.Casino.GameInfo=="undefined"&&(BAHWeb.App.Services.Casino.GameInfo=gtc("GameInfo:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services.Casino"),BAHWeb.App.Services.Casino.GameInfo.registerClass("BAHWeb.App.Services.Casino.GameInfo"));Type.registerNamespace("BAHWeb.App.Services.User");typeof BAHWeb.App.Services.User.UnsubscribeNewsletterResponse=="undefined"&&(BAHWeb.App.Services.User.UnsubscribeNewsletterResponse=gtc("UnsubscribeNewsletterResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services.User"),BAHWeb.App.Services.User.UnsubscribeNewsletterResponse.registerClass("BAHWeb.App.Services.User.UnsubscribeNewsletterResponse"));typeof BAHWeb.App.Services.User.PasswordExpiredResponse=="undefined"&&(BAHWeb.App.Services.User.PasswordExpiredResponse=gtc("PasswordExpiredResponse:http://schemas.datacontract.org/2004/07/BAHWeb.App.Services.User"),BAHWeb.App.Services.User.PasswordExpiredResponse.registerClass("BAHWeb.App.Services.User.PasswordExpiredResponse"));typeof BAHWeb.App.Services.SportBonusState=="undefined"&&(BAHWeb.App.Services.SportBonusState=function(){throw Error.invalidOperation();},BAHWeb.App.Services.SportBonusState.prototype={Allowed:1,NotAllowed:2,UserNotVerified:3},BAHWeb.App.Services.SportBonusState.registerEnum("BAHWeb.App.Services.SportBonusState",!0));typeof BAHWeb.App.Core.Services.SvcResponseState=="undefined"&&(BAHWeb.App.Core.Services.SvcResponseState=function(){throw Error.invalidOperation();},BAHWeb.App.Core.Services.SvcResponseState.prototype={Success:0,Error:1,NotAuthenticated:2},BAHWeb.App.Core.Services.SvcResponseState.registerEnum("BAHWeb.App.Core.Services.SvcResponseState",!0));Type.registerNamespace("BAHWeb.App.Classes.Account");typeof BAHWeb.App.Classes.Account.AuthenticationStatus=="undefined"&&(BAHWeb.App.Classes.Account.AuthenticationStatus=function(){throw Error.invalidOperation();},BAHWeb.App.Classes.Account.AuthenticationStatus.prototype={Authenticated:0,Unknown:1,Locked:2,InvalidPassword:3,LoginDenied:4,WrongJurisdiction:5,Error:11,Blocked:12,PokerLoginNotAllowed:17,Migration:6,ExternalVerificationNecessary:7,InternalVerificationNecessary:8,InternalReverificationNecessary:9,Closed:10,ContractAcceptanceNecessary:13,LockedRegistrationSuspended:14,ClosedRegistrationSuspended:15,ChangeExpiredPassword:16},BAHWeb.App.Classes.Account.AuthenticationStatus.registerEnum("BAHWeb.App.Classes.Account.AuthenticationStatus",!0));typeof BAHWeb.Common.Classes.General.GamingGameMode=="undefined"&&(BAHWeb.Common.Classes.General.GamingGameMode=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.General.GamingGameMode.prototype={PlayForFun:0,PlayForReal:1},BAHWeb.Common.Classes.General.GamingGameMode.registerEnum("BAHWeb.Common.Classes.General.GamingGameMode",!0));typeof BAHWeb.Common.Classes.General.Jurisdiction=="undefined"&&(BAHWeb.Common.Classes.General.Jurisdiction=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.General.Jurisdiction.prototype={None:0,COM:1,IT:2,DE:3,UK:4},BAHWeb.Common.Classes.General.Jurisdiction.registerEnum("BAHWeb.Common.Classes.General.Jurisdiction",!0));typeof BAHWeb.Common.Classes.General.LandingpageType=="undefined"&&(BAHWeb.Common.Classes.General.LandingpageType=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.General.LandingpageType.prototype={Welcome:0,Teaser:1,HomeVariantSport:2,HomeVariantCasino:3,HomeVariantPoker:4,OddBanner:5,WelcomeOddBanner:6,QrVoucherCode:7},BAHWeb.Common.Classes.General.LandingpageType.registerEnum("BAHWeb.Common.Classes.General.LandingpageType",!0));typeof BAHWeb.Common.Classes.General.BetClassification=="undefined"&&(BAHWeb.Common.Classes.General.BetClassification=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.General.BetClassification.prototype={None:0,Sportbet:1,Livebet:2,BetradarLivebet:3,Prematch:4,PrematchInactive:5},BAHWeb.Common.Classes.General.BetClassification.registerEnum("BAHWeb.Common.Classes.General.BetClassification",!0));typeof BAHWeb.Common.Classes.Sport.OddType=="undefined"&&(BAHWeb.Common.Classes.Sport.OddType=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.Sport.OddType.prototype={Unknown:0,OddType1:1,OddType2:2,OddType3:3},BAHWeb.Common.Classes.Sport.OddType.registerEnum("BAHWeb.Common.Classes.Sport.OddType",!0));typeof BAHWeb.Common.Classes.Sport.RenderType=="undefined"&&(BAHWeb.Common.Classes.Sport.RenderType=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.Sport.RenderType.prototype={CorrectScore:0,OneCol:1,TwoCols:2,ThreeCols:3},BAHWeb.Common.Classes.Sport.RenderType.registerEnum("BAHWeb.Common.Classes.Sport.RenderType",!0));typeof BAHWeb.Common.Classes.Sport.OrderType=="undefined"&&(BAHWeb.Common.Classes.Sport.OrderType=function(){throw Error.invalidOperation();},BAHWeb.Common.Classes.Sport.OrderType.prototype={Empty:0,E:1,K:2,S:3,M:4},BAHWeb.Common.Classes.Sport.OrderType.registerEnum("BAHWeb.Common.Classes.Sport.OrderType",!0));Type.registerNamespace("BAHWeb.ExternalTransactionInterface");typeof BAHWeb.ExternalTransactionInterface.TransactionReturnCode=="undefined"&&(BAHWeb.ExternalTransactionInterface.TransactionReturnCode=function(){throw Error.invalidOperation();},BAHWeb.ExternalTransactionInterface.TransactionReturnCode.prototype={Ok:0,Nok:1,ErrorNotAllowed:2,ErrorGuest:3,ErrorLogin:4,ErrorApiPing:5,ErrorApiLogin:6,ErrorMaintenance:7,ErrorAmountFormat:8,ErrorAmountLimitMin:9,ErrorAmountLimitMax:10,ErrorAmountBonus:11,ErrorForfeitBonus:12,ErrorDbTransaction:13,ErrorApiTransaction:14,ErrorUserContract:15},BAHWeb.ExternalTransactionInterface.TransactionReturnCode.registerEnum("BAHWeb.ExternalTransactionInterface.TransactionReturnCode",!0));Type.registerNamespace("BAHWeb.App.Classes.Account.Payment");typeof BAHWeb.App.Classes.Account.Payment.PaymentStatus=="undefined"&&(BAHWeb.App.Classes.Account.Payment.PaymentStatus=function(){throw Error.invalidOperation();},BAHWeb.App.Classes.Account.Payment.PaymentStatus.prototype={Ok:0,NoUser:1,NotPossible:2,IsGuest:3,MinAmount:4,MaxAmount:5,UserBalanceExceeded:6,DepositLimit:7,InvalidData:8,Error:9,ServiceUnavailable:10,AuthRequired:11,Maintenance:12,ChargeRequired:13,CreditCardAuthorizationError:14,WithdrawableAmount:15},BAHWeb.App.Classes.Account.Payment.PaymentStatus.registerEnum("BAHWeb.App.Classes.Account.Payment.PaymentStatus",!0));BAHWeb.Validation=function(){this.MailcheckDomains=["gmail.com","hotmail.com","wp.pl","yahoo.com","o2.pl","abv.bg","web.de","interia.pl","seznam.cz","freemail.hu","gmx.de","op.pl","gmx.at","mail.ru","azet.sk","yahoo.de","tlen.pl","hotmail.de","poczta.onet.pl","vp.pl","t-online.de","aol.com","poczta.fm","gmx.net","citromail.hu","yandex.ru","libero.it","net.hr","mynet.com","freenet.de","centrum.cz","centrum.sk","aon.at","hotmail.it","onet.eu","msn.com","mail.bg","live.com","googlemail.com","arcor.de","gazeta.pl","rambler.ru","yahoo.co.uk","yahoo.es","chello.at","interia.eu","zoznam.sk","email.cz","yahoo.it","post.sk","go2.pl","live.de","onet.pl","hotmail.co.uk","alice.it","neostrada.pl","ymail.com","buziaczek.pl","sms.at","atlas.cz","tiscali.it","bluewin.ch","autograf.pl","sapo.pt","windowslive.com","vipmail.hu","ukr.net","bk.ru","gmx.ch","pobox.sk","live.at","orangemail.sk","virgilio.it","online.de","list.ru","volny.cz","live.it","t-online.hu","inbox.ru","email.si","siol.net","live.nl","iol.pt","liwest.at","hotmail.es","live.com.pt","mail.com","t-com.me","yahoo.pl","inode.at","rocketmail.com","a1.net","terra.es","lycos.de"];this.MailcheckTopLevelDomains=["at","bg","cc","ch","com","co.uk","cz","de","edu","es","eu","fm","gov","hu","info","it","me","nl","net","org","pl","pt","ru","si","sk"]};BAHWeb.Validation.prototype={Init:function(){this.BindValidationTooltipBehaviour();this.BindInputHighlighting();this.InitDatepicker()},BindValidationTooltipBehaviour:function(){$("div.input-text-wrapper .tlt-validation").click(function(){$(this).toggleClass("s-hiddenImportant",!0)});$("div.input-text-wrapper").hover(function(){$(".tlt-validation",this).css("z-index",905)},function(){$(".tlt-validation",this).css("z-index",900)})},BindInputHighlighting:function(){$("tr select, tr input[type=radio], tr input[type=checkbox], tr input[type=text], tr input[type=password], tr textarea").not(".m-transferFromInput").bind("focusin focusout",function(n){var t=$(this).closest("tr");n.type=="focusin"&&t.addClass("s-emphasized");n.type=="focusout"&&t.removeClass("s-emphasized")})},InitDatepicker:function(){var n;n=BAHWeb.Variables.Lang.toLowerCase()==="en"?$.datepicker.regional[""]:BAHWeb.Variables.Lang.toLowerCase()==="nl"?$.datepicker.regional.nl:$.datepicker.regional[BAHWeb.Variables.Lang.toLowerCase()];n&&(n.prevText="",n.nextText="",$.datepicker.setDefaults(n));$("#content").on("focusin","input.m-datepicker",function(){if(!$(this).data("datepicker")){var n=$(this).data("mindate")||null,t=$(this).data("maxdate")||null,i=$(this).data("yearrange")||null;$(this).datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd.mm.yy",firstDay:1,minDate:n,maxDate:t,yearRange:i,constrainInput:!0,onClose:validation.Datepicker_UpdateCheck,onChangeMonthYear:function(n,t,i){if(i.currentDay!==0){var u=new Date(n,t,0,23,59,59).getUTCDate(),r=i.selectedDay;r>u&&(r=u);$(this).datepicker("setDate",new Date(n,t-1,r))}}})}})},MaxLength_ClientValidate:function(n,t){var i=$("#"+$("#"+n.id)[0].controltovalidate)[0],r=i.getAttribute("data-minlength");t.IsValid=i.value.length>i.maxLength?!1:r>0&&i.value.trim().length<r?!1:!0},TrimValue:function(n){n.value=n.value.replace(/^\s*/,"").replace(/\s*$/,"")},EmailSuggestion_ClientValidate:function(n,t){Kicksend.mailcheck.run({email:t.Value,domains:this.MailcheckDomains,topLevelDomains:this.MailcheckTopLevelDomains,suggested:function(i){n.OpenErrorValidationBehavior._errorMessage=String.format(BAHWeb.Translations.VALIDATOR_EMAIL,i.full);n.OpenErrorValidationBehavior._isSuggestion=!0;t.IsValid=!1},empty:function(){n.OpenErrorValidationBehavior._isSuggestion=!1;$("#"+n.controltovalidate)[0]._isSuggestion=!1;t.IsValid=!0}})},CheckBoxRequired_ClientValidate:function(n){var t=$("#"+$("#"+n.id)[0].controltovalidate)[0];return t.tagName=="INPUT"?t.checked?(t._isValid=!0,!0):(t._isValid=!1,!1):(t._isValid=!1,!1)},TrimValidator_ClientValidate:function(n,t){var i=$("#"+n.controltovalidate);i.val(i.val().replace(/^\s*/,"").replace(/\s*$/,""));t.IsValid=!0},CheckTextboxValidity_ClientValidate:function(n,t){var i=$("#"+n.controltovalidate)[0],u,f,r;if(i&&!i.disabled){for(u=!0,f=i.Validators.length,r=0;r<f;r++)if(i.Validators[r].OpenErrorValidationBehavior!==undefined&&i.Validators[r].OpenErrorValidationBehavior!==null&&i.Validators[r].OpenErrorValidationBehavior._isDependingOnInnerValidatedControl!==!0&&i.Validators[r].enabled!==!1&&i.Validators[r].isvalid===!1){u=!1;break}i._isValid=u?!0:!1}t.IsValid=!0},DrpSelection_ClientValidate:function(n,t){var i=$("#"+$("#"+n.id)[0].controltovalidate)[0],r=i.getAttribute("data-required");t.IsValid=!0;i._isValid=!0;r=="true"&&i.value=="-1"&&(t.IsValid=!1,i._isValid=!1)},DrpBirthdateYear_ClientValidate:function(n,t){var i=$("#"+n.controltovalidate)[0],u=$("#"+n.controltovalidate.replace("year","month"))[0],f=$("#"+n.controltovalidate.replace("year","day"))[0],r;i.value!=="-1"&&u.value!=="-1"&&f.value!=="-1"&&(r=new Date(i.value,u.value-1,f.value,0,0,0,0),r.getFullYear()==i.value&&r.getMonth()==u.value-1&&r.getDate()==f.value?(t.IsValid=!0,i._isValid=!0):(t.IsValid=!1,i._isValid=!1))},DrpBirthdateDay_ClientValidate:function(n,t){var r=$("#"+n.controltovalidate.replace("day","year"))[0],u=$("#"+n.controltovalidate.replace("day","month"))[0],i=$("#"+n.controltovalidate)[0];r.value!=="-1"&&u.value!=="-1"&&i.value!=="-1"&&$("#"+n.controltovalidate.replace("day","year")).trigger("change");t.IsValid=!0;i._isValid=!0},DrpBirthdateMonth_ClientValidate:function(n,t){var r=$("#"+n.controltovalidate.replace("month","year"))[0],i=$("#"+n.controltovalidate)[0],u=$("#"+n.controltovalidate.replace("month","day"))[0];r.value!=="-1"&&i.value!=="-1"&&u.value!=="-1"&&$("#"+n.controltovalidate.replace("month","year")).trigger("change");t.IsValid=!0;i._isValid=!0},DrpBirthdateMultiSelection_ClientValidate:function(n,t){var i=$("#"+n.controltovalidate.replace("hidden","year")+"_drpList")[0],r=$("#"+n.controltovalidate.replace("hidden","month")+"_drpList")[0],u=$("#"+n.controltovalidate.replace("hidden","day")+"_drpList")[0];t.IsValid=i.value!=="-1"&&r.value!=="-1"&&u.value!=="-1"},Creditcard_Luhn_IsValid:function(n,t){var r,i,u;if(t&&(n=n.replace(/ /g,"")),!n.match(/^\d+$/))return!1;for(r=0,i=0;i<n.length;i++)u=n.charAt(n.length-i-1)-"0"<<(i&1),r+=u>9?u-9:u;return r%10==0&&r>0},Creditcard_Luhn_ClientValidate:function(n){var t=window.ValidatorGetValue(n.controltovalidate);return t.length<1&&n.evaluationempty===!0?!0:validation.Creditcard_Luhn_IsValid(t,n.evaluationspaces===!0)},DecimalMinMax_ClientValidate:function(n,t){var r=parseFloat($("#"+n.controltovalidate)[0].getAttribute("data-maxVal")),u=parseFloat($("#"+n.controltovalidate)[0].getAttribute("data-minVal")),i=parseFloat(t.Value);t.IsValid=i<=r&&i>=u?!0:!1},MaxLengthCurrency_ClientValidate:function(n,t){var i=$("#"+$("#"+n.id)[0].controltovalidate)[0],r=i.getAttribute("data-minLength"),u=i.value.replace(".00","").replace(".0","");t.IsValid=u.length>i.maxLength?!1:r>0&&u.length<r?!1:!0},SetEnglishAmountFormat_ClientValidate:function(n,t){var i=$("#"+n.controltovalidate),r=i.val().replace(",",".");if(r.length===0||isNaN(r)){i.val("0.00");return}i.val(parseFloat(r).toFixed(2));t.IsValid=!0},EnableValidators:function(n,t,i){validation.SetValidatorEnabledMode(n,!0,t,i)},DisableValidators:function(n,t){validation.SetValidatorEnabledMode(n,!1,!0,t)},SetValidatorEnabledMode:function(n,t,i,r){if(typeof i=="undefined"&&(i=!1),typeof r=="undefined"&&(r=!0),typeof n=="string"){var u=$(n+" .m-validated");u.length<1&&(u=$(n+".m-validated"));u.each(function(){validation.SetEnabledModeForValidatorList($(this)[0].Validators,t,i);(!i||r)&&validation.UpdateValidatorDisplayStatus($(this)[0],t)})}else typeof n=="object"&&(validation.SetEnabledModeForValidatorList(n[0].Validators,t,i),(!i||r)&&validation.UpdateValidatorDisplayStatus(n[0],t))},SetEnabledModeForValidatorList:function(n,t,i){for(var r=0;r<n.length;r++)t?n[r].getAttribute("data-allowenabling")?n[r].getAttribute("data-allowenabling").toLowerCase()!="false"&&(n[r].enabled=!0):n[r].enabled=!0:n[r].enabled=!1,i?window.ValidatorValidate(n[r],n[r].validationGroup,null):n[r].isvalid=!0},UpdateValidatorDisplayStatus:function(n,t){(n.type==="text"||n.type==="checkbox")&&(t?n.CloseErrorValidationBehaviour._checkValidators():(n.CloseErrorValidationBehaviour._reset(),n._isValid=undefined),n.CheckValidationBehavior&&(t?n.CheckValidationBehavior._checkValidators():n.CheckValidationBehavior._reset()),n.CheckDoubleValidationBehavior&&(t?n.CheckDoubleValidationBehavior._checkValidators():n.CheckDoubleValidationBehavior._reset()))},CheckOptionalValidatedInput:function(n,t){$(n).val()!==""&&$(t).val()!==""?(window.EnableValidators(t,!0),window.EnableValidators(n,!0)):$(n).val()!==""?(window.DisableValidators(t),window.EnableValidators(n,!0)):$(t).val()!==""&&(window.DisableValidators(n),window.EnableValidators(t,!0))},MoveValidatedDialogToForm:function(n){$(n).parent().appendTo($("form:first"))},Datepicker_UpdateCheck:function(n,t){t.input.trigger("focusout")},TriggerOnChangeOnFocusOut:function(n){n=n||window.event;var t;t=typeof n.srcElement!="undefined"&&n.srcElement!==null?n.srcElement:n.target;t.value&&window.ValidatorOnChange&&window.ValidatorOnChange(n)},EnsureSubmitOnce:function(n,t){if(typeof Page_ClientValidate=="function"&&window.Page_ClientValidate(t)===!1)return!1;if(n=$(n),n.is("input")&&n.attr("type")=="button")n.prop("disabled",!0),n.toggleClass("s-disabled",!0);else if(n.is("a")){if(n.attr("isSubmited")==="true")return!1;n.attr("isSubmited",!0);n.toggleClass("s-disabled",!0)}return!0}};validation=new BAHWeb.Validation;$(document).ready(function(){validation.Init()});BAHWeb.General=BAHWeb.General||{};BAHWeb.General.Conversion=function(){};BAHWeb.General.Conversion.prototype={Init:function(){},ConvertToFloat:function(n){var i=0,t;return n&&(t=n.toString(),t=t.replace(/\,/g,"."),(t===null||t.length<=0)&&(t=0),i=parseFloat(t)),i},FormatFloatForScreen:function(n){var t="0.00";return n&&(t=parseFloat(n).toFixed(2)),t.replace(/\,/g,".")}};conversion=new BAHWeb.General.Conversion;Type.registerNamespace("ExtenderBehaviors");ExtenderBehaviors.CheckDoubleValidationBehavior=function(n){ExtenderBehaviors.CheckDoubleValidationBehavior.initializeBase(this,[n]);this._invalidCssClass=null;this._validCssClass=null;this._targetControl=null;this._secondTargetControlId=null};ExtenderBehaviors.CheckDoubleValidationBehavior.prototype={initialize:function(){ExtenderBehaviors.CheckDoubleValidationBehavior.callBaseMethod(this,"initialize");$(this.get_element()).bind("focusout",$.proxy(this._checkValidators,this));this._onLoad()},dispose:function(){$(this.get_element()).unbind("focusout",$.proxy(this._checkValidators,this));ExtenderBehaviors.CheckDoubleValidationBehavior.callBaseMethod(this,"dispose")},CheckValidators:function(){var n=$("#"+this._targetControl),t=this.get_element(),i=$("#"+this._secondTargetControlId)[0];t._isValid===!0&&i._isValid?(n.removeClass(this._invalidCssClass),n.addClass(this._validCssClass)):(n.removeClass(this._validCssClass),n.addClass(this._invalidCssClass))},_reset:function(){$("#"+this._targetControl).removeClass(this._validCssClass);$("#"+this._targetControl).addClass(this._invalidCssClass)},_checkValidators:function(n){this.get_element()&&!this.get_element().disabled&&this.CheckValidators(n)},_onLoad:function(n){this.get_element()&&!this.get_element().disabled&&this.get_element().value!==""&&this.CheckValidators(n)},get_invalidCssClass:function(){return this._invalidCssClass},set_invalidCssClass:function(n){this._invalidCssClass!==n&&(this._invalidCssClass=n,this.raisePropertyChanged("invalidCssClass"))},get_validCssClass:function(){return this._validCssClass},set_validCssClass:function(n){this._validCssClass!==n&&(this._validCssClass=n,this.raisePropertyChanged("validCssClass"))},get_secondTargetControlId:function(){return this._secondTargetControlId},set_secondTargetControlId:function(n){this._secondTargetControlId!==n&&(this._secondTargetControlId=n,this.raisePropertyChanged("secondTargetControlId"))},get_targetControl:function(){return this._targetControl},set_targetControl:function(n){this._targetControl!==n&&(this._targetControl=n,this.raisePropertyChanged("targetControl"))}};ExtenderBehaviors.CheckDoubleValidationBehavior.descriptor={properties:[{name:"invalidCssClass",type:String},{name:"validCssClass",type:String},{name:"secondTargetControlId",type:String},{name:"targetControl",type:String}]};ExtenderBehaviors.CheckDoubleValidationBehavior.registerClass("ExtenderBehaviors.CheckDoubleValidationBehavior",Sys.UI.Behavior);typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("ExtenderBehaviors");ExtenderBehaviors.CheckValidationBehavior=function(n){ExtenderBehaviors.CheckValidationBehavior.initializeBase(this,[n]);this._invalidCssClass=null;this._validCssClass=null;this._targetControl=null};ExtenderBehaviors.CheckValidationBehavior.prototype={initialize:function(){ExtenderBehaviors.CheckValidationBehavior.callBaseMethod(this,"initialize");$(this.get_element()).bind("focusout",$.proxy(this._checkValidators,this));this._onLoad()},dispose:function(){$(this.get_element()).unbind("focusout",$.proxy(this._checkValidators,this));ExtenderBehaviors.CheckValidationBehavior.callBaseMethod(this,"dispose")},CheckValidators:function(){var n=$("#"+this._targetControl);this.get_element()._isValid===!0?(n.removeClass(this._invalidCssClass),n.addClass(this._validCssClass)):(n.removeClass(this._validCssClass),n.addClass(this._invalidCssClass))},_reset:function(){$("#"+this._targetControl).removeClass(this._validCssClass);$("#"+this._targetControl).addClass(this._invalidCssClass)},_checkValidators:function(n){this.get_element()&&!this.get_element().disabled&&this.CheckValidators(n)},_onLoad:function(n){this.get_element()&&!this.get_element().disabled&&this.get_element().value!==""&&this.CheckValidators(n)},get_invalidCssClass:function(){return this._invalidCssClass},set_invalidCssClass:function(n){this._invalidCssClass!==n&&(this._invalidCssClass=n,this.raisePropertyChanged("invalidCssClass"))},get_validCssClass:function(){return this._validCssClass},set_validCssClass:function(n){this._validCssClass!==n&&(this._validCssClass=n,this.raisePropertyChanged("validCssClass"))},get_targetControl:function(){return this._targetControl},set_targetControl:function(n){this._targetControl!==n&&(this._targetControl=n,this.raisePropertyChanged("targetControl"))}};ExtenderBehaviors.CheckValidationBehavior.descriptor={properties:[{name:"invalidCssClass",type:String},{name:"validCssClass",type:String},{name:"targetControl",type:String}]};ExtenderBehaviors.CheckValidationBehavior.registerClass("ExtenderBehaviors.CheckValidationBehavior",Sys.UI.Behavior);typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("ExtenderBehaviors");ExtenderBehaviors.CloseErrorValidationBehaviour=function(n){ExtenderBehaviors.CloseErrorValidationBehaviour.initializeBase(this,[n]);this._invalidCssClass=null;this._targetErrorBox=null};ExtenderBehaviors.CloseErrorValidationBehaviour.prototype={initialize:function(){ExtenderBehaviors.CloseErrorValidationBehaviour.callBaseMethod(this,"initialize");$(this.get_element()).bind("focusout",$.proxy(this._checkValidators,this));$(this.get_element()).bind("change",$.proxy(this._checkValidators,this))},dispose:function(){$(this.get_element()).unbind("focusout",$.proxy(this._checkValidators,this));$(this.get_element()).unbind("change",$.proxy(this._checkValidators,this));ExtenderBehaviors.CloseErrorValidationBehaviour.callBaseMethod(this,"dispose")},_reset:function(){$("#"+this._targetErrorBox).addClass(this._invalidCssClass)},_checkValidators:function(){this.get_element()&&!this.get_element().disabled&&this.get_element()._isValid===!0&&this.get_element()._isSuggestion!==!0&&$("*[id*="+this._targetErrorBox+"]").addClass(this._invalidCssClass)},get_invalidCssClass:function(){return this._invalidCssClass},set_invalidCssClass:function(n){this._invalidCssClass!==n&&(this._invalidCssClass=n,this.raisePropertyChanged("invalidCssClass"))},get_targetErrorBox:function(){return this._targetErrorBox},set_targetErrorBox:function(n){this._targetErrorBox!==n&&(this._targetErrorBox=n,this.raisePropertyChanged("targetErrorBox"))}};ExtenderBehaviors.CloseErrorValidationBehaviour.descriptor={properties:[{name:"invalidCssClass",type:String},{name:"targetErrorBox",type:String}]};ExtenderBehaviors.CloseErrorValidationBehaviour.registerClass("ExtenderBehaviors.CloseErrorValidationBehaviour",Sys.UI.Behavior);typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("ExtenderBehaviors");ExtenderBehaviors.OpenErrorValidationBehavior=function(n){ExtenderBehaviors.OpenErrorValidationBehavior.initializeBase(this,[n]);this._invalidCssClass=null;this._validCssClass=null;this._selfManagedErrorBox=null;this._isSuggestion=null;this._openOnInitialLoad=null;this._originalValidationMethod=null;this._validationMethodOverride=null;this._elementToValidate=null;this._isPostBack=!1;this._isDependingOnInnerValidatedControl=!1};ExtenderBehaviors.OpenErrorValidationBehavior.prototype={initialize:function(){ExtenderBehaviors.OpenErrorValidationBehavior.callBaseMethod(this,"initialize");$(this.get_element()).bind("focusout",$.proxy(this._onValidate,this));var n=this.get_element();this._elementToValidate=$("#"+n.controltovalidate);n.evaluationfunction&&(this._originalValidationMethod=Function.createDelegate(n,n.evaluationfunction),this._validationMethodOverride=Function.createDelegate(this,this._onValidate),n.evaluationfunction=this._validationMethodOverride);this._elementToValidate.attr("type")==="text"&&this._elementToValidate.unbind("focusout",validation.TriggerOnChangeOnFocusOut).bind("focusout",validation.TriggerOnChangeOnFocusOut);this._onLoad()},dispose:function(){$(this.get_element()).unbind("focusout",$.proxy(this._onValidate,this));ExtenderBehaviors.OpenErrorValidationBehavior.callBaseMethod(this,"dispose")},_onValidate:function(n){var t=!0,i,r;if(this._isDependingOnInnerValidatedControl&&(i=$("#"+n.controltovalidate)[0],r=$("#"+n.controltocompare)[0],t=r._isValid===undefined?!0:r._isValid===!0,t=t&&(i._isValid===undefined?!0:i._isValid===!0),t&&(r.CloseErrorValidationBehaviour._reset(),i.CloseErrorValidationBehaviour._reset())),t)return this._originalValidationMethod(n)?(this._selfManagedErrorBox&&this._invalidCssClass&&($("#"+this._targetErrorBox).addClass(this._invalidCssClass),$(".tlt-content",$("#"+this._targetErrorBox)).text("")),!0):(this._invalidCssClass&&($("#"+this._targetErrorBox).removeClass(this._invalidCssClass),$(".tlt-content",$("#"+this._targetErrorBox)).text(this._errorMessage)),this._isDependingOnInnerValidatedControl&&($("#"+n.controltovalidate)[0]._isValid=!1),this._isSuggestion?($("#"+n.id)[0].isvalid=!0,$("#"+n.controltovalidate)[0]._isSuggestion=!0,!0):($("#"+n.id)[0].isvalid=!1,$("#"+n.controltovalidate)[0]._isSuggestion=!1,!1));$("#"+this._targetErrorBox).addClass(this._invalidCssClass)},_onLoad:function(n){this.get_element()&&!this.get_element().disabled&&(this.get_element().isvalid===!1&&this._isPostBack===!0&&this._invalidCssClass||this._openOnInitialLoad===!0&&this._isPostBack===!1?($("#"+this._targetErrorBox).removeClass(this._invalidCssClass),this._errorMessage!==null&&this._errorMessage!==""?$(".tlt-content",$("#"+this._targetErrorBox)).text(this._errorMessage):$(".tlt-content",$("#"+this._targetErrorBox)).text(this.get_element().errormessage)):this._elementToValidate.val()!==""&&this._elementToValidate.attr("type")==="text"&&this._elementToValidate.prop("_isValid")===undefined&&window.ValidatorValidate(this.get_element(),this.get_element().validationGroup,n))},get_isSuggestion:function(){return this._isSuggestion},set_isSuggestion:function(n){this._isSuggestion!==n&&(this._isSuggestion=n,this.raisePropertyChanged("isSuggestion"))},get_invalidCssClass:function(){return this._invalidCssClass},set_invalidCssClass:function(n){this._invalidCssClass!==n&&(this._invalidCssClass=n,this.raisePropertyChanged("invalidCssClass"))},get_validCssClass:function(){return this._validCssClass},set_validCssClass:function(n){this._validCssClass!==n&&(this._validCssClass=n,this.raisePropertyChanged("validCssClass"))},get_errorMessage:function(){return this._errorMessage},set_errorMessage:function(n){this._errorMessage!==n&&(this._errorMessage=n,this.raisePropertyChanged("errorMessage"))},get_targetErrorBox:function(){return this._targetErrorBox},set_targetErrorBox:function(n){this._targetErrorBox!==n&&(this._targetErrorBox=n,this.raisePropertyChanged("targetErrorBox"))},get_selfManagedErrorBox:function(){return this._selfManagedErrorBox},set_selfManagedErrorBox:function(n){this._selfManagedErrorBox!==n&&(this._selfManagedErrorBox=n,this.raisePropertyChanged("selfManagedErrorBox"))},get_isPostBack:function(){return this._isPostBack},set_isPostBack:function(n){this._isPostBack!==n&&(this._isPostBack=n,this.raisePropertyChanged("isPostBack"))},get_openOnInitialLoad:function(){return this._openOnInitialLoad},set_openOnInitialLoad:function(n){this._openOnInitialLoad!==n&&(this._openOnInitialLoad=n,this.raisePropertyChanged("openOnInitialLoad"))},get_isDependingOnInnerValidatedControl:function(){return this._isDependingOnInnerValidatedControl},set_isDependingOnInnerValidatedControl:function(n){this._isDependingOnInnerValidatedControl!==n&&(this._isDependingOnInnerValidatedControl=n,this.raisePropertyChanged("isDependingOnInnerValidatedControl"))}};ExtenderBehaviors.OpenErrorValidationBehavior.descriptor={properties:[{name:"invalidCssClass",type:String},{name:"validCssClass",type:String},{name:"errorMessage",type:String},{name:"targetErrorBox",type:String},{name:"selfManagedErrorBox",type:Boolean},{name:"isSuggestion",type:Boolean},{name:"isPostBack",type:Boolean},{name:"openOnInitialLoad",type:Boolean},{name:"isDependingOnInnerValidatedControl",type:Boolean}]};ExtenderBehaviors.OpenErrorValidationBehavior.registerClass("ExtenderBehaviors.OpenErrorValidationBehavior",Sys.UI.Behavior);typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();Type.registerNamespace("ExtenderBehaviors");ExtenderBehaviors.PasswordStrengthBehavior=function(n){ExtenderBehaviors.PasswordStrengthBehavior.initializeBase(this,[n]);this._targetControl=null};ExtenderBehaviors.PasswordStrengthBehavior.prototype={initialize:function(){ExtenderBehaviors.PasswordStrengthBehavior.callBaseMethod(this,"initialize");$(this.get_element()).bind("keyup",$.proxy(this._checkStrength,this));$(this.get_element()).bind("focusout",$.proxy(this._checkStrength,this));var n=$("*[id*="+this._targetControl+"]");n.css("width","0px")},dispose:function(){$(this.get_element()).unbind("keyup",$.proxy(this._checkStrength,this));$(this.get_element()).unbind("focusout",$.proxy(this._checkStrength,this));ExtenderBehaviors.PasswordStrengthBehavior.callBaseMethod(this,"dispose")},_checkStrength:function(){if(this.get_element()&&!this.get_element().disabled){var t=$("*[id*="+this._targetControl+"]"),n=this.get_element().value,i=new RegExp(this._invalid),r=new RegExp(this._tooShort),u=new RegExp(this._numbers),f=new RegExp(this._lettersBig),e=new RegExp(this._lettersSmall),o=new RegExp(this._lettersMixed),s=new RegExp(this._numberslettersBig),h=new RegExp(this._numberslettersSmall),c=new RegExp(this._securePassword),l=new RegExp(this._moreSecurePassword);l.test(n)?t.css("width","176px"):c.test(n)?t.css("width","140px"):o.test(n)||s.test(n)||h.test(n)?t.css("width","105px"):f.test(n)||e.test(n)||u.test(n)?t.css("width","70px"):r.test(n)||i.test(n)?t.css("width","35px"):t.css("width","35px")}},_reset:function(){$('*[id*="tbPasswordRep_txtBox"]').val("");$('*[id*="tbPassword_txtBox"]').val("");$('*[id*="tbPassword_validationCheck"]').removeClass("i-checkMark14x14").addClass("i-checkMarkGray14x14");$('*[id*="tbPasswordRep_validationCheck"]').removeClass("i-checkMark14x14").addClass("i-checkMarkGray14x14");$('*[id*="passwordMeterContainer"]').css("width","0px")},get_targetControl:function(){return this._targetControl},set_targetControl:function(n){this._targetControl!==n&&(this._targetControl=n,this.raisePropertyChanged("targetControl"))},get_invalid:function(){return this._invalid},set_invalid:function(n){this._invalid!==n&&(this._invalid=n,this.raisePropertyChanged("invalid"))},get_tooShort:function(){return this._tooShort},set_tooShort:function(n){this._tooShort!==n&&(this._tooShort=n,this.raisePropertyChanged("tooShort"))},get_numbers:function(){return this._numbers},set_numbers:function(n){this._numbers!==n&&(this._numbers=n,this.raisePropertyChanged("numbers"))},get_lettersBig:function(){return this._lettersBig},set_lettersBig:function(n){this._lettersBig!==n&&(this._lettersBig=n,this.raisePropertyChanged("lettersBig"))},get_lettersSmall:function(){return this._lettersSmall},set_lettersSmall:function(n){this._lettersSmall!==n&&(this._lettersSmall=n,this.raisePropertyChanged("lettersSmall"))},get_lettersMixed:function(){return this._lettersMixed},set_lettersMixed:function(n){this._lettersMixed!==n&&(this._lettersMixed=n,this.raisePropertyChanged("lettersMixed"))},get_numberslettersBig:function(){return this._numberslettersBig},set_numberslettersBig:function(n){this._numberslettersBig!==n&&(this._numberslettersBig=n,this.raisePropertyChanged("numberslettersBig"))},get_numberslettersSmall:function(){return this._numberslettersSmall},set_numberslettersSmall:function(n){this._numberslettersSmall!==n&&(this._numberslettersSmall=n,this.raisePropertyChanged("numberslettersSmall"))},get_securePassword:function(){return this._securePassword},set_securePassword:function(n){this._securePassword!==n&&(this._securePassword=n,this.raisePropertyChanged("securePassword"))},get_moreSecurePassword:function(){return this._moreSecurePassword},set_moreSecurePassword:function(n){this._moreSecurePassword!==n&&(this._moreSecurePassword=n,this.raisePropertyChanged("moreSecurePassword"))}};ExtenderBehaviors.PasswordStrengthBehavior.descriptor={properties:[{name:"targetControl",type:String},{name:"invalid",type:RegExp},{name:"tooShort",type:RegExp},{name:"numbers",type:RegExp},{name:"lettersBig",type:RegExp},{name:"lettersSmall",type:RegExp},{name:"lettersMixed",type:RegExp},{name:"numberslettersBig",type:RegExp},{name:"numberslettersSmall",type:RegExp},{name:"securePassword",type:RegExp},{name:"moreSecurePassword",type:RegExp}]};ExtenderBehaviors.PasswordStrengthBehavior.registerClass("ExtenderBehaviors.PasswordStrengthBehavior",Sys.UI.Behavior);typeof Sys!="undefined"&&Sys.Application.notifyScriptLoaded();BAHWeb.General=BAHWeb.General||{};BAHWeb.General.Italy=function(){};BAHWeb.General.Italy.prototype={Init:function(){},ContractAccepted:function(){var n=iusersvc.iuserservice;n.ContractAccepted(function(){var n=n||window.event;behaviors.CloseDialog(n,"ContractAcceptance")},function(){$("#pnlError").removeClass("s-hidden");$("#contractAcceptanceNecessaryContent").addClass("s-hidden")})},ChangeExpiredPassword:function(){var n=iusersvc.iuserservice;n.ChangeExpiredPassword($("#tbNewPassword_tbPasswordRep input").val(),$("#tbOldPassword input").val(),function(n){switch(n.StatusCode){case 0:$("#pnlConfirmation").removeClass("s-hidden");$("#pnlForm").addClass("s-hidden");$("#btnPnlConfirmation").attr("onclick",'window.location.replace("'+n.RedirectUrl+'");');break;case 1:$("#ebChangePwdWrapper").removeClass("s-hidden");$("#btnSubmit").removeClass("s-disabled").removeAttr("issubmited");$("#tbOldPassword input").val("");$("#tbOldPassword_validationCheck").removeClass("i-checkMark14x14").addClass("i-checkMarkGray14x14");$("#tbNewPassword_tbPassword_txtBox")[0].PasswordStrengthBehavior._reset();break;default:$("#pnlError").removeClass("s-hidden");$("#pnlForm").addClass("s-hidden")}},function(){$("#pnlError").removeClass("s-hidden");$("#pnlForm").addClass("s-hidden")})}};italy=new BAHWeb.General.Italy;$.widget("bah.fluidgrid",{windowRef:null,resizeEventProxy:null,columnsCur:null,options:{defaultColumns:5,arrColumnOptions:[{columns:1,maxWidth:320},{columns:2,maxWidth:600},{columns:3,maxWidth:1080},{columns:4,maxWidth:1360},{columns:5,minWidth:1360}]},_create:function(){this.windowRef=$(window);this._OnResizeWindow();this.resizeEventProxy=$.proxy(this._OnResizeWindow,this);this.windowRef.resize(this.resizeEventProxy)},Update:function(){this._OnResizeWindow()},_OnResizeWindow:function(){var n=this._CalculateNumOfColumns();n!=this.columnsCur&&this._ChangeColumns(n)},_CalculateNumOfColumns:function(){for(var i=this.windowRef.width(),n,t=0;t<this.options.arrColumnOptions.length;t++)if(n=this.options.arrColumnOptions[t],(!n.maxWidth||i<n.maxWidth)&&(!n.minWidth||i>=n.maxWidth))return n.columns;return this.options.defaultColumns},_ChangeColumns:function(n){this._UpdateColumnClass(n);this._UpdateGrid(n);this.columnsCur=n},_UpdateGrid:function(n){for(var f=this.element,r=$(".l-grid-mainItem",f),o=$(".l-grid-subItems",f),s=Math.ceil(r.length/n),t,e,i,u=0;u<s;u++)t=u*n,e=o.slice(t,t+n),i=t+n-1,i=Math.min(i,r.length-1),e.insertAfter(r[i])},_UpdateColumnClass:function(n){for(var i=this.element,r=$(".l-grid-subItems",i),t=1;t<=8;t++)i.removeClass("l-grid"+t),r.removeClass("l-grid"+t);i.addClass("l-grid"+n);r.addClass("l-grid"+n)},destroy:function(){this.windowRef.off("resize",this.resizeEventProxy);this.windowRef=null;this.resizeEventProxy=null;this.options.arrColumnOptions=null;this.options.defaultColumns=null;this.columnsCur=null;$.Widget.prototype.destroy.call(this)}});
/**
* History.js jQuery Adapter
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
(function(n,t){"use strict";var i=n.History=n.History||{},r=n.jQuery;if(typeof i.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");i.Adapter={bind:function(n,t,i){r(n).bind(t,i)},trigger:function(n,t,i){r(n).trigger(t,i)},extractEventData:function(n,i,r){return i&&i.originalEvent&&i.originalEvent[n]||r&&r[n]||t},onDomLoad:function(n){r(n)}};typeof i.init!="undefined"&&i.init()})(window);
/**
* History.js Core
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
(function(n,t){"use strict";var e=n.console||t,r=n.document,o=n.navigator,f=n.sessionStorage||!1,h=n.setTimeout,c=n.clearTimeout,l=n.setInterval,a=n.clearInterval,u=n.JSON,v=n.alert,i=n.History=n.History||{},s=n.history;try{f.setItem("TEST","1");f.removeItem("TEST")}catch(y){f=!1}if(u.stringify=u.stringify||u.encode,u.parse=u.parse||u.decode,typeof i.init!="undefined")throw new Error("History.js Core has already been loaded...");i.init=function(){return typeof i.Adapter=="undefined"?!1:(typeof i.initCore!="undefined"&&i.initCore(),typeof i.initHtml4!="undefined"&&i.initHtml4(),!0)};i.initCore=function(){if(typeof i.initCore.initialized!="undefined")return!1;i.initCore.initialized=!0;i.options=i.options||{};i.options.hashChangeInterval=i.options.hashChangeInterval||100;i.options.safariPollInterval=i.options.safariPollInterval||500;i.options.doubleCheckInterval=i.options.doubleCheckInterval||500;i.options.disableSuid=i.options.disableSuid||!1;i.options.storeInterval=i.options.storeInterval||1e3;i.options.busyDelay=i.options.busyDelay||250;i.options.debug=i.options.debug||!1;i.options.initialTitle=i.options.initialTitle||r.title;i.options.html4Mode=i.options.html4Mode||!1;i.options.delayInit=i.options.delayInit||!1;i.intervalList=[];i.clearAllIntervals=function(){var n,t=i.intervalList;if(typeof t!="undefined"&&t!==null){for(n=0;n<t.length;n++)a(t[n]);i.intervalList=null}};i.debug=function(){(i.options.debug||!1)&&i.log.apply(i,arguments)};i.log=function(){var s=!(typeof e=="undefined"||typeof e.log=="undefined"||typeof e.log.apply=="undefined"),t=r.getElementById("log"),n,f,h,o,i;for(s?(o=Array.prototype.slice.call(arguments),n=o.shift(),typeof e.debug!="undefined"?e.debug.apply(e,[n,o]):e.log.apply(e,[n,o])):n="\n"+arguments[0]+"\n",f=1,h=arguments.length;f<h;++f){if(i=arguments[f],typeof i=="object"&&typeof u!="undefined")try{i=u.stringify(i)}catch(c){}n+="\n"+i+"\n"}return t?(t.value+=n+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):s||v(n),!0};
/**
* History.getInternetExplorerMajorVersion()
* Get's the major version of Internet Explorer
* @return {integer}
* @license Public Domain
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @author James Padolsey <https://gist.github.com/527683>
*/
i.getInternetExplorerMajorVersion=function(){return i.getInternetExplorerMajorVersion.cached=typeof i.getInternetExplorerMajorVersion.cached!="undefined"?i.getInternetExplorerMajorVersion.cached:function(){for(var n=3,t=r.createElement("div"),i=t.getElementsByTagName("i");(t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->")&&i[0];);return n>4?n:!1}()};
/**
* History.isInternetExplorer()
* Are we using Internet Explorer?
* @return {boolean}
* @license Public Domain
* @author Benjamin Arthur Lupton <contact@balupton.com>
*/
if(i.isInternetExplorer=function(){return i.isInternetExplorer.cached=typeof i.isInternetExplorer.cached!="undefined"?i.isInternetExplorer.cached:Boolean(i.getInternetExplorerMajorVersion())},i.emulated=i.options.html4Mode?{pushState:!0,hashChange:!0}:{pushState:!Boolean(n.history&&n.history.pushState&&n.history.replaceState&&!(/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(o.userAgent)||/AppleWebKit\/5([0-2]|3[0-2])/i.test(o.userAgent))),hashChange:Boolean(!("onhashchange"in n||"onhashchange"in r)||i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8)},i.enabled=!i.emulated.pushState,i.bugs={setHash:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),safariPoll:Boolean(!i.emulated.pushState&&o.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(o.userAgent)),ieDoubleCheck:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(i.isInternetExplorer()&&i.getInternetExplorerMajorVersion()<7)},i.isEmptyObject=function(n){for(var t in n)if(n.hasOwnProperty(t))return!1;return!0},i.cloneObject=function(n){var i,t;return n?(i=u.stringify(n),t=u.parse(i)):t={},t},i.getRootUrl=function(){var n=r.location.protocol+"//"+(r.location.hostname||r.location.host);return(r.location.port||!1)&&(n+=":"+r.location.port),n+"/"},i.getBaseHref=function(){var t=r.getElementsByTagName("base"),i=null,n="";return t.length===1&&(i=t[0],n=i.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},i.getBaseUrl=function(){return i.getBaseHref()||i.getBasePageUrl()||i.getRootUrl()},i.getPageUrl=function(){var n=i.getState(!1,!1),t=(n||{}).url||i.getLocationHref();return t.replace(/\/+$/,"").replace(/[^\/]+$/,function(n){return/\./.test(n)?n:n+"/"})},i.getBasePageUrl=function(){return i.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(n){return/[^\/]$/.test(n)?"":n}).replace(/\/+$/,"")+"/"},i.getFullUrl=function(n,t){var u=n,r=n.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(n)||(u=r==="/"?i.getRootUrl()+n.replace(/^\/+/,""):r==="#"?i.getPageUrl().replace(/#.*/,"")+n:r==="?"?i.getPageUrl().replace(/[\?#].*/,"")+n:t?i.getBaseUrl()+n.replace(/^(\.\/)+/,""):i.getBasePageUrl()+n.replace(/^(\.\/)+/,"")),u.replace(/\#$/,"")},i.getShortUrl=function(n){var t=n,r=i.getBaseUrl(),u=i.getRootUrl();return i.emulated.pushState&&(t=t.replace(r,"")),t=t.replace(u,"/"),i.isTraditionalAnchor(t)&&(t="./"+t),t.replace(/^(\.\/)+/g,"./").replace(/\#$/,"")},i.getLocationHref=function(n){return(n=n||r,n.URL===n.location.href)?n.location.href:n.location.href===decodeURIComponent(n.URL)?n.URL:n.location.hash&&decodeURIComponent(n.location.href.replace(/^[^#]+/,""))===n.location.hash?n.location.href:n.URL.indexOf("#")==-1&&n.location.href.indexOf("#")!=-1?n.location.href:n.URL||n.location.href},i.store={},i.idToState=i.idToState||{},i.stateToId=i.stateToId||{},i.urlToId=i.urlToId||{},i.storedStates=i.storedStates||[],i.savedStates=i.savedStates||[],i.normalizeStore=function(){i.store.idToState=i.store.idToState||{};i.store.urlToId=i.store.urlToId||{};i.store.stateToId=i.store.stateToId||{}},i.getState=function(n,t){typeof n=="undefined"&&(n=!0);typeof t=="undefined"&&(t=!0);var r=i.getLastSavedState();return!r&&t&&(r=i.createStateObject()),n&&(r=i.cloneObject(r),r.url=r.cleanUrl||r.url),r},i.getIdByState=function(n){var t=i.extractId(n.url),r;if(!t)if(r=i.getStateString(n),typeof i.stateToId[r]!="undefined")t=i.stateToId[r];else if(typeof i.store.stateToId[r]!="undefined")t=i.store.stateToId[r];else{for(;;)if(t=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),typeof i.idToState[t]=="undefined"&&typeof i.store.idToState[t]=="undefined")break;i.stateToId[r]=t;i.idToState[t]=n}return t},i.normalizeState=function(n){var t,r;return(n&&typeof n=="object"||(n={}),typeof n.normalized!="undefined")?n:(n.data&&typeof n.data=="object"||(n.data={}),t={},t.normalized=!0,t.title=n.title||"",t.url=i.getFullUrl(n.url?n.url:i.getLocationHref()),t.hash=i.getShortUrl(t.url),t.data=i.cloneObject(n.data),t.id=i.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,r=!i.isEmptyObject(t.data),(t.title||r)&&i.options.disableSuid!==!0&&(t.hash=i.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=i.getFullUrl(t.hash),(i.emulated.pushState||i.bugs.safariPoll)&&i.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t)},i.createStateObject=function(n,t,r){var u={data:n,title:t,url:r};return i.normalizeState(u)},i.getStateById=function(n){n=String(n);return i.idToState[n]||i.store.idToState[n]||t},i.getStateString=function(n){var t,r;return t=i.normalizeState(n),r={data:t.data,title:n.title,url:n.url},u.stringify(r)},i.getStateId=function(n){var t;return t=i.normalizeState(n),t.id},i.getHashByState=function(n){var t;return t=i.normalizeState(n),t.hash},i.extractId=function(n){var i,t,u,r;return r=n.indexOf("#")!=-1?n.split("#")[0]:n,t=/(.*)\&_suid=([0-9]+)$/.exec(r),u=t?t[1]||n:n,i=t?String(t[2]||""):"",i||!1},i.isTraditionalAnchor=function(n){return!/[\/\?\.]/.test(n)},i.extractState=function(n,t){var r=null,u,f;return t=t||!1,u=i.extractId(n),u&&(r=i.getStateById(u)),r||(f=i.getFullUrl(n),u=i.getIdByUrl(f)||!1,u&&(r=i.getStateById(u)),r||!t||i.isTraditionalAnchor(n)||(r=i.createStateObject(null,null,f))),r},i.getIdByUrl=function(n){return i.urlToId[n]||i.store.urlToId[n]||t},i.getLastSavedState=function(){return i.savedStates[i.savedStates.length-1]||t},i.getLastStoredState=function(){return i.storedStates[i.storedStates.length-1]||t},i.hasUrlDuplicate=function(n){var t;return t=i.extractState(n.url),t&&t.id!==n.id},i.storeState=function(n){return i.urlToId[n.url]=n.id,i.storedStates.push(i.cloneObject(n)),n},i.isLastSavedState=function(n){var t=!1,r,u,f;return i.savedStates.length&&(r=n.id,u=i.getLastSavedState(),f=u.id,t=r===f),t},i.saveState=function(n){return i.isLastSavedState(n)?!1:(i.savedStates.push(i.cloneObject(n)),!0)},i.getStateByIndex=function(n){return typeof n=="undefined"?i.savedStates[i.savedStates.length-1]:n<0?i.savedStates[i.savedStates.length+n]:i.savedStates[n]},i.getCurrentIndex=function(){return i.savedStates.length<1?0:i.savedStates.length-1},i.getHash=function(n){var t=i.getLocationHref(n);return i.getHashByUrl(t)},i.unescapeHash=function(n){var t=i.normalizeHash(n);return decodeURIComponent(t)},i.normalizeHash=function(n){return n.replace(/[^#]*#/,"").replace(/#.*/,"")},i.setHash=function(n,t){var u,f;return t!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.setHash,args:arguments,queue:t}),!1):(i.busy(!0),u=i.extractState(n,!0),u&&!i.emulated.pushState?i.pushState(u.data,u.title,u.url,!1):i.getHash()!==n&&(i.bugs.setHash?(f=i.getPageUrl(),i.pushState(null,null,f+"#"+n,!1)):r.location.hash=n),i)},i.escapeHash=function(t){var r=i.normalizeHash(t);return r=n.encodeURIComponent(r),i.bugs.hashEscape||(r=r.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),r},i.getHashByUrl=function(n){var t=String(n).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return i.unescapeHash(t)},i.setTitle=function(n){var t=n.title,u;t||(u=i.getStateByIndex(0),u&&u.url===n.url&&(t=u.title||i.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(f){}return r.title=t,i},i.queues=[],i.busy=function(n){if(typeof n!="undefined"?i.busy.flag=n:typeof i.busy.flag=="undefined"&&(i.busy.flag=!1),!i.busy.flag){c(i.busy.timeout);var t=function(){var n,r,u;if(!i.busy.flag)for(n=i.queues.length-1;n>=0;--n)(r=i.queues[n],r.length!==0)&&(u=r.shift(),i.fireQueueItem(u),i.busy.timeout=h(t,i.options.busyDelay))};i.busy.timeout=h(t,i.options.busyDelay)}return i.busy.flag},i.busy.flag=!1,i.fireQueueItem=function(n){return n.callback.apply(n.scope||i,n.args||[])},i.pushQueue=function(n){return i.queues[n.queue||0]=i.queues[n.queue||0]||[],i.queues[n.queue||0].push(n),i},i.queue=function(n,t){return typeof n=="function"&&(n={callback:n}),typeof t!="undefined"&&(n.queue=t),i.busy()?i.pushQueue(n):i.fireQueueItem(n),i},i.clearQueue=function(){return i.busy.flag=!1,i.queues=[],i},i.stateChanged=!1,i.doubleChecker=!1,i.doubleCheckComplete=function(){return i.stateChanged=!0,i.doubleCheckClear(),i},i.doubleCheckClear=function(){return i.doubleChecker&&(c(i.doubleChecker),i.doubleChecker=!1),i},i.doubleCheck=function(n){return i.stateChanged=!1,i.doubleCheckClear(),i.bugs.ieDoubleCheck&&(i.doubleChecker=h(function(){return i.doubleCheckClear(),i.stateChanged||n(),!0},i.options.doubleCheckInterval)),i},i.safariStatePoll=function(){var r=i.extractState(i.getLocationHref()),t;if(!i.isLastSavedState(r))return t=r,t||(t=i.createStateObject()),i.Adapter.trigger(n,"popstate"),i},i.back=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.back,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.back(!1)}),s.go(-1),!0)},i.forward=function(n){return n!==!1&&i.busy()?(i.pushQueue({scope:i,callback:i.forward,args:arguments,queue:n}),!1):(i.busy(!0),i.doubleCheck(function(){i.forward(!1)}),s.go(1),!0)},i.go=function(n,t){var r;if(n>0)for(r=1;r<=n;++r)i.forward(t);else if(n<0)for(r=-1;r>=n;--r)i.back(t);else throw new Error("History.go: History.go requires a positive or negative integer passed.");return i},i.emulated.pushState){var y=function(){};i.pushState=i.pushState||y;i.replaceState=i.replaceState||y}else i.onPopState=function(t,r){var e=!1,u=!1,o,f;return(i.doubleCheckComplete(),o=i.getHash(),o)?(f=i.extractState(o||i.getLocationHref(),!0),f?i.replaceState(f.data,f.title,f.url,!1):(i.Adapter.trigger(n,"anchorchange"),i.busy(!1)),i.expectedStateId=!1,!1):(e=i.Adapter.extractEventData("state",t,r)||!1,u=e?i.getStateById(e):i.expectedStateId?i.getStateById(i.expectedStateId):i.extractState(i.getLocationHref()),u||(u=i.createStateObject(null,null,i.getLocationHref())),i.expectedStateId=!1,i.isLastSavedState(u))?(i.busy(!1),!1):(i.storeState(u),i.saveState(u),i.setTitle(u),i.Adapter.trigger(n,"statechange"),i.busy(!1),!0)},i.Adapter.bind(n,"popstate",i.onPopState),i.pushState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.pushState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.pushState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0},i.replaceState=function(t,r,u,f){if(i.getHashByUrl(u)&&i.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(f!==!1&&i.busy())return i.pushQueue({scope:i,callback:i.replaceState,args:arguments,queue:f}),!1;i.busy(!0);var e=i.createStateObject(t,r,u);return i.isLastSavedState(e)?i.busy(!1):(i.storeState(e),i.expectedStateId=e.id,s.replaceState(e.id,e.title,e.url),i.Adapter.trigger(n,"popstate")),!0};if(f){try{i.store=u.parse(f.getItem("History.store"))||{}}catch(p){i.store={}}i.normalizeStore()}else i.store={},i.normalizeStore();if(i.Adapter.bind(n,"unload",i.clearAllIntervals),i.saveState(i.storeState(i.extractState(i.getLocationHref(),!0))),f&&(i.onUnload=function(){var n,t,r;try{n=u.parse(f.getItem("History.store"))||{}}catch(o){n={}}n.idToState=n.idToState||{};n.urlToId=n.urlToId||{};n.stateToId=n.stateToId||{};for(t in i.idToState)i.idToState.hasOwnProperty(t)&&(n.idToState[t]=i.idToState[t]);for(t in i.urlToId)i.urlToId.hasOwnProperty(t)&&(n.urlToId[t]=i.urlToId[t]);for(t in i.stateToId)i.stateToId.hasOwnProperty(t)&&(n.stateToId[t]=i.stateToId[t]);i.store=n;i.normalizeStore();r=u.stringify(n);try{f.setItem("History.store",r)}catch(e){if(e.code===DOMException.QUOTA_EXCEEDED_ERR)f.length&&(f.removeItem("History.store"),f.setItem("History.store",r));else throw e;}},i.intervalList.push(l(i.onUnload,i.options.storeInterval)),i.Adapter.bind(n,"beforeunload",i.onUnload),i.Adapter.bind(n,"unload",i.onUnload)),!i.emulated.pushState&&(i.bugs.safariPoll&&i.intervalList.push(l(i.safariStatePoll,i.options.safariPollInterval)),(o.vendor==="Apple Computer, Inc."||(o.appCodeName||"")==="Mozilla")&&(i.Adapter.bind(n,"hashchange",function(){i.Adapter.trigger(n,"popstate")}),i.getHash())))i.Adapter.onDomLoad(function(){i.Adapter.trigger(n,"hashchange")})};i.options&&i.options.delayInit||i.init()})(window);$(document).ready(function(){$(".m-accordion").accordion({active:!1,collapsible:!0,heightStyle:"content"})});BAHWeb.General=BAHWeb.General||{};BAHWeb.General.GoogleAnalytics=function(){};BAHWeb.General.GoogleAnalytics.prototype={Init:function(){},SendPageView:function(n){window.ga("send","pageview",n)},SendEvent:function(n,t,i){window.ga("send","event",n,t,i)}};googleAnalytics=new BAHWeb.General.GoogleAnalytics;
This looks like a 3rd party library - if so you should exclude it from instrumentation.
I can't see anything obviously wrong with the instrumented code on first glance, but will keep looking. Can you check that you are using the latest version of JSCover.
After instrumenting the following JS-file
the file gets corrupted and has the error: "cannot read property '1' of undefined"