function pageLoad(){$(document).foundation();$("#lbJSRun").html().split(",").forEach(function(n){var t=n.split("("),i=window[t[0]],r="";t[1]!=undefined&&(r=t[1].replace(")",""));typeof i=="function"&&i(r)});$("#tbTimeZone").val()!="NA"&&$("#tbTimeZone").val(-(new Date).getTimezoneOffset());$("#lbJSRun").html("")}function AppInit(){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End)}function End(){$("#PageUpdateProgress").hide()}function focusElement(n){try{if(n.indexOf("btn")!=-1)return;if($('[name="'+n+'"').attr("id")!=undefined){$('[name="'+n+'"').is(":visible")&&$('[name="'+n+'"').focus();return}if($("#"+n).attr("id")!=undefined){$("#"+n).is(":visible")&&$("#"+n).focus();return}}catch(t){}}function applyTimeZone(n){var t=new Date(dDate(n)),i=-t.getTimezoneOffset(),r=new Date(t.getTime()+i*6e4);return sDateTime(r)}function removeTimeZone(n){var t=new Date(dDate(n)),i=-t.getTimezoneOffset(),r=new Date(t.getTime()-i*6e4);return sDateTime(r)}function showPageUpdateProgress(){$("#PageUpdateProgress").show()}function hidePageUpdateProgress(){$("#PageUpdateProgress").hide()}function showlbUnsaved(){$("#lbUnSaved").removeClass("hide");$("#lbUnSaved").show()}function hidelbUnsaved(){$("#lbUnSaved").addClass("hide");$("#lbUnSaved").hide()}function showlbSaved(){$("#lbSaved").removeClass("hide");$("#lbSaved").show();$("#lbSaved").delay(1500).fadeOut("slow")}function hidelbSaved(){$("#lbSaved").addClass("hide");$("#lbSaved").hide()}function error(n,t){try{var i="Default.aspx?Function=JSError&JSFunction="+t+"&Error="+n;$.ajax({type:"POST",url:i,cache:!1});$("#lbTitle").css("backgroundColor","#FFFFFF");$("#lbTitle").animateHighlight("#FF0000",1e3);showDialog("Error",null,"Error","An error has occured and been logged.  If the matter is urgent, please contact support. <\/br><\/br>"+n)}catch(r){alert("exception caught - "+r)}}function showDialog(n,t,i,r){try{var u;switch(n){case"ChangeModule":case"ChangeTab":case"Back":if($("#lbUnSaved").is(":visible"))i="Warning",r="Unsaved changes will be lost. Are you sure you want to continue?",u="OkCancelDoPostBack";else return!0;break;case"DeleteRecord":i="Warning";r="Are you sure you want delete the current record?";u="OkCancelDoPostBack";break;case"DeleteRow":i="Warning";r="Are you sure you want to delete this row?";u="OkCancelDoPostBack";break;case"DeleteFile":i="Warning";r="Are you sure you want to delete this file?";u="OkCancelDoPostBack";break;default:i==undefined&&(i=$("#lbDialogTitle").html(),$("#lbDialogTitle").html(""));r==undefined&&(r=$("#lbDialogContent").html(),$("#lbDialogContent").html(""));u==undefined&&(u=$("#lbDialogButtons").html(),$("#lbDialogButtons").html(""));u==""&&(u="Ok")}if(i==undefined||i=="")return!0;$("#dialog").html(r).dialog({title:i,modal:!0});switch(u){case"Ok":$("#dialog").dialog({buttons:{Ok:function(){$(this).dialog("close")}}});break;case"OkCancel":$("#dialog").dialog({buttons:{Ok:function(){$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}});break;case"OkCancelDoPostBack":$("#dialog").dialog({buttons:{Ok:function(){n=="ChangeTab"?(t.options.owner.set_activeTab(t),t.raiseClick(t),t._header.focus(),$(this).dialog("close")):(arr=getPostback(t),__doPostBack(arr[0],arr[1]),$(this).dialog("close"))},Cancel:function(){$(this).dialog("close")}}})}return!1}catch(f){error(f,"showDialog - "+n+" "+t)}}function getPostback(n){var r=$(n).attr("href").replace("javascript:__doPostBack('","").replace("','","").replace("')",""),i=r.split(","),u=i[0],t=i[1];return t==undefined&&(t=""),[u,t]}function checkForm(n){var t;try{return t=0,$(n+" .required").each(function(){$(this).prop("type")=="text"||$(this).prop("type")=="textarea"?$(this).val()==""?$(this).addClass("notValid"):$(this).removeClass("notValid"):$(this).prop("type")=="select-one"&&($(this).val()==""?$(this).addClass("notValid"):$(this).removeClass("notValid"))}),t=$(n+" .notValid").length,t==0?!0:($(n+" .notValid").animateHighlight("#FFFF00 !important",1e3),$(n+" .notValid:first").focus(),!1)}catch(i){error(i,"checkForm - "+n.id)}}function Uploading(n){var t=n.get_id(),i=document.getElementById("lbPID").innerText,r="Servlet.aspx?Function=SetSession&V1=UploadPage&V1v="+i+"&V2=UploadControl&V2v="+t;try{$.ajax({type:"POST",url:r,cache:!1})}catch(u){error(u,"Uploading")}sleepForSeconds(3)}function UploadComplete(){__doPostBack("","")}function sleepForSeconds(n){for(var t=(new Date).getTime();new Date<t+n*1e3;);return!0}function UploadOnChange(){$(".ajax__fileupload").bind("change",function(){setTimeout(function(){$(".ajax__fileupload_uploadbutton").trigger("click")},100)});$(".ajax__fileupload_dropzone").bind("drop",function(){setTimeout(function(){$(".ajax__fileupload_uploadbutton").trigger("click")},100)})}function PostBack(n){__doPostBack(n,"")}function ColourBox(n){n.get_element().style.color="#"+n.get_selectedColor().replace("#","").substring(0,6);n.text=n.get_selectedColor().replace("#","").substring(0,6)}function number_format(n,t,i,r){n=(n+"").replace(/[^0-9+\-Ee.]/g,"");var e=isFinite(+n)?+n:0,f=isFinite(+t)?Math.abs(t):0,o=typeof r=="undefined"?",":r,s=typeof i=="undefined"?".":i,u="",h=function(n,t){var i=Math.pow(10,t);return""+Math.round(n*i)/i};return u=(f?h(e,f):""+Math.round(e)).split("."),u[0].length>3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),(u[1]||"").length<f&&(u[1]=u[1]||"",u[1]+=new Array(f-u[1].length+1).join("0")),u.join(s)}function sDate(n){return("0"+n.getDate()).slice(-2)+"/"+("0"+(n.getMonth()+1)).slice(-2)+"/"+n.getFullYear()}function sDateTime(n){return("0"+n.getDate()).slice(-2)+"/"+("0"+(n.getMonth()+1)).slice(-2)+"/"+n.getFullYear()+" "+n.getHours()+":"+n.getMinutes()}function sCurrentDate(){var n=new Date;return("0"+n.getDate()).slice(-2)+"/"+("0"+(n.getMonth()+1)).slice(-2)+"/"+n.getFullYear()+" "+n.getHours()+":"+n.getMinutes()}function dDate(n){var t;return n.length==10?new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2)):n.length==13?new Date(n.substring(4,8),n.substring(2,4)-1,n.substring(0,2),n.substring(9,11),n.substring(11,13)):n.length==16?new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2),n.substring(11,13),n.substring(14,16)):void 0}function isValidDate(n){return Object.prototype.toString.call(n)!=="[object Date]"?!1:!isNaN(n.getTime())}function isValidEmailAddress(n){var t=new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);return t.test(n)}function showDateFields(n){var s=$("#"+n.id.substring(0,n.id.length-12)+"ddYear").parent(),t=$("#"+n.id.substring(0,n.id.length-12)+"ddQuarter").parent(),i=$("#"+n.id.substring(0,n.id.length-12)+"ddFiscalYear").parent(),r=$("#"+n.id.substring(0,n.id.length-12)+"ddMonthYear").parent(),u=$("#"+n.id.substring(0,n.id.length-12)+"dtFromDate").parent(),f=$("#"+n.id.substring(0,n.id.length-12)+"dtToDate").parent(),e=$("#"+n.id.substring(0,n.id.length-12)+"dtFromDateTime").parent(),o=$("#"+n.id.substring(0,n.id.length-12)+"dtToDateTime").parent();if($(n).is(":visible"))switch(n.value){case"Current":case"Last3Months":s.hide();t.hide();i.hide();r.hide();u.hide();f.hide();e.hide();o.hide();break;case"All":s.hide();t.hide();i.hide();r.hide();u.hide();f.hide();e.hide();o.hide();break;case"Year":s.show();t.hide();i.hide();r.hide();u.hide();f.hide();e.hide();o.hide();break;case"Quarter":s.show();t.show();i.hide();r.hide();u.hide();f.hide();e.hide();o.hide();break;case"FiscalYear":s.hide();t.hide();i.show();r.hide();u.hide();f.hide();e.hide();o.hide();break;case"MonthYear":s.hide();t.hide();i.show();r.show();u.hide();f.hide();e.hide();o.hide();break;case"Custom":s.hide();t.hide();i.hide();r.hide();u.show();f.show();e.show();o.show()}else t.hide(),i.hide(),r.hide(),u.hide(),f.hide(),e.hide(),o.hide()}function log10(n){return Math.log(n)/Math.LN10}function scrollTop(){$("html, body").animate({scrollTop:0})}function fixTopBar(){try{$(".modal-bg :visible").length==0?$(".fvButtonBar").each(function(){$(window).scrollTop()>100&&$(this).is(":visible")==!0&&$("#pnlButtonBarFixed").length==0?($("#top").fadeOut("fast"),$("#title").css("top","0"),$(this).clone().hide().appendTo("#titleContent").attr("id","pnlButtonBarFixed").fadeIn("fast")):$(window).scrollTop()<=100&&$("#pnlButtonBarFixed").length>0&&($("#pnlButtonBarFixed").fadeOut("fast").remove(),$("#top").fadeIn("fast"),$("#title").css("top","2.5rem"))}):$(".fvButtonBar").each(function(){$(this).parents(".fvModal").length==0&&$(this).hide()})}catch(n){error(n,"fixTopBar")}}function showHideModal(n,t){try{$("#"+n).find("#"+t).length>0?($("#"+n+"_bg").show(),$("#"+n).fadeIn("slow")):($("#"+n+"_bg").fadeOut("fast"),$("#"+n).fadeOut("fast"))}catch(i){error(i,"showModal")}}function getPageScroll(){var n;return self.pageYOffset?n=self.pageYOffset:document.documentElement&&document.documentElement.scrollTop?n=document.documentElement.scrollTop:document.body&&(n=document.body.scrollTop),n}function resizeMe(){var n=$(document).width(),t,i,r;n<=640?t=440:n>641&&n<=769?t=768:n>769&&n<=1025?t=1024:n>1025&&n<=1441?t=1440:n>1441&&(t=1920);i=n/t;r=Math.floor(16*i);$("html").css("font-size",r)}function addCommas(n){n+="";for(var i=n.split("."),t=i[0],u=i.length>1?"."+i[1]:"",r=/(\d+)(\d{3})/;r.test(t);)t=t.replace(r,"$1,$2");return t+u}function Common(){var n,t;prevTabIndex=$(".ajax__tab_container ").index();lbUnSavedHidden=$("#lbUnSaved").hasClass("hide");$(".hideTabHeader").each(function(){$("#"+$(this).attr("id")+"_tab").hide()});$("#btnMenuUser").text()==""&&($("#btnMenuUser").hide(),$("#btnMenuLogout").hide());n=$("#userMenu").filter(function(){return $(this).css("display")!=="none"}).length;n>0&&$("#userMenu").hide();$(".toggle-topbar").toggle(function(){var n=$("#top-bar");tbHeight=n.height();autoHeight=n.css("height","auto").height();n.height(tbHeight).animate({height:autoHeight},700)},function(){var n=$("#top-bar");autoHeight=n.height();n.animate({height:tbHeight},700)});$(".toggle-div").toggle(function(){var n=$(this).next();autoWidth=n.css("width","auto").width();autoHeight=n.css("height","auto").height();n.width(0).height(0).animate({height:autoHeight,width:autoWidth},{duration:500})},function(){var n=$(this).next();autoHeight=n.height();autoWidth=n.width();n.animate({height:0,width:0},{duration:300})});$(".btnMenu").on("click",function(){if(!event.ctrlKey)return showDialog("ChangeModule",this)});$(".lbRecordStatus").each(function(){$(this).html()==""&&$(this).html("<b>NEW RECORD<\/b>")});$(".ajax__tab_disabled").each(function(){$("#"+$(this).attr("id").replace("__tab_","")+"_tab").hide()});window.scroll(0,$("#tbYScroll").val());$(".tablesorter").each(function(){$(this).tablesorter({sortList:[[0,0],[1,0]]})});$("#lbSaved").hasClass("hide")?$("#lbSaved").show():$("#lbSaved").delay(1500).fadeOut("slow");$("#pnlError").on("click",function(){$(this).fadeOut()});$(".modal-bg").each(function(){$(this).find(".fv").length>0||$(this).find(".gv").length>0?($(this).show(),$(this).find(".modal").show()):($(this).fadeOut("fast"),$(this).fadeOut("fast"))});$(".gvDiv").each(function(){$(this).find(".gv").length>0?$(this).show():$(this).hide()});$(".gvHeadingButton").each(function(){$(this).next().is(":visible")==!0?$(this).show():$(this).hide()});$(".hideDiv").each(function(){$(this).closest("div").hide()});$(".capitalise").on("blur",function(){this.value=this.value.toLowerCase().replace(/^(.)|\s(.)/g,function(n){return n.toUpperCase()});(this.value.indexOf("Mc")!=-1||this.value.indexOf("O'")!=-1)&&(this.value=this.value.slice(0,2)+this.value.slice(2,3).toUpperCase()+this.value.slice(3))});$(".textBoxCurrency").each(function(){var i=$(this).attr("onchange"),t,n;$(this).attr("onchange","");$(this).hasClass("label")?(t=$(this).html(),n=$(this).html().indexOf(".")):(t=$(this).val(),n=$(this).val().indexOf("."));$(this).hasClass("Int")||t!=""&&n==-1?(n>0&&$(this).val($(this).val().slice(0,n)),$(this).mask("999,999,999",{reverse:!0})):$(this).mask("999,999,999.99",{reverse:!0});i!=undefined&&$(this).attr("onchange",i);$(this).text()!=""?$(this).text("$"+$(this).text()):$(this).val()!=""&&$(this).val("$"+$(this).val())});$(".textBoxCurrency").on("blur",function(){$(this).text().replace(/\$/g,"")!=""?$(this).text("$"+$(this).text().replace(/\$/g,"")):$(this).val().replace(/\$/g,"")!=""&&$(this).val("$"+$(this).val().replace(/\$/g,""))});$(".locked").attr("readonly",!0);$(".textBoxPercent").mask("9?9.99%");$(".textBoxNumber").keyup(function(){[37,39,36,35].indexOf(event.keyCode)>-1||(this.value=this.value.replace(/[^0-9\.-]/g,""))});$(".textBoxNumberInt").keyup(function(){[37,39,36,35].indexOf(event.keyCode)>-1||(this.value=this.value.replace(/[^0-9-]/g,""))});$(".textBoxDate").on("blur",function(){var t=$(this),n,i,f,r,u;if(t.val()==""){t.removeClass("notValid");return}if(t.val(t.val().replace(/\/\//g,"/").replace(/-/g,"/").replace(/[^0-9\/]/g,"")),n=t.val().replace(/\//g,""),i=n.length,i==6?(f=(new Date).getFullYear()<parseInt("20"+n.slice(i-2,i))?"19"+n.slice(i-2,i):"20"+n.slice(i-2,i),t.val(n.substring(0,2)+"/"+n.substring(2,4)+"/"+f)):i==8&&t.val(n.substring(0,2)+"/"+n.substring(2,4)+"/"+n.substring(4,8)),n=t.val(),n.indexOf("/")==-1){t.addClass("notValid");return}if(ad=n.split("/"),r=parseInt(ad[1]),!(r>=1&&r<=12)){t.addClass("notValid");return}u=new Date(ad[2],r-1,ad[0]);n==""||isValidDate(u)==!0&&u.getFullYear()>1900&&u.getFullYear()<(new Date).getFullYear()+50?t.removeClass("notValid"):t.addClass("notValid")});$(".textBoxDate").keyup(function(){[8,27].indexOf(event.keyCode)>-1&&$(this).AnyTime_noPicker()});$(".textBoxTime").on("blur",function(){var n=$(this),t,u,i,r;if(n.val()==""){n.removeClass("notValid");return}if(n.val(n.val().replace(/\//g,"").replace(/-/g,"/").replace(/[^0-9\/]/g,"")),t=n.val(),u=t.length,u==4&&n.val(t.substring(0,2)+":"+t.substring(2,4)),t=n.val(),t.indexOf(":")==-1){n.addClass("notValid");return}at=t.split(":");i=parseInt(at[0]);r=parseInt(at[1]);t==""||i>=0&&i<=24&&r>=0&&r<=59?n.removeClass("notValid"):n.addClass("notValid")});$(".textBoxTime").keyup(function(){[8,27].indexOf(event.keyCode)>-1&&$(this).AnyTime_noPicker()});$(".textBoxDateTime").on("blur",function(){var t=$(this),n,r,e;if(t.val()==""){t.removeClass("notValid");return}if(t.val(t.val().replace(/\//g,"").replace(/-/g,"/").replace(/[^0-9\/]/g,"")),n=t.val(),n!=""){if(r=n.length,r==10?(e=(new Date).getFullYear()<parseInt("20"+n.substring(4,6))?"19"+n.substring(4,6):"20"+n.substring(4,6),t.val(n.substring(0,2)+"/"+n.substring(2,4)+"/"+e+" "+n.substring(6,8)+":"+n.substring(8,10))):r==12&&t.val(n.substring(0,2)+"/"+n.substring(2,4)+"/"+n.substring(4,8)+" "+n.substring(8,10)+":"+n.substring(10,12)),n=t.val(),n.indexOf(" ")==-1||n.indexOf("/")==-1||n.indexOf(":")==-1){t.addClass("notValid");return}var o=n.split(" "),u=o[0].split("/"),s=o[1].split(":"),i=parseInt(u[1]);if(!(i>=1&&i<=12)){t.addClass("notValid");return}var h=parseInt(s[0]),i=parseInt(s[1]),f=new Date(u[2],i-1,u[0]);n==""||isValidDate(f)==!0&&f.getFullYear()>1900&&f.getFullYear()<(new Date).getFullYear()+50&&h>=0&&h<=24&&i>=0&&i<=59?t.removeClass("notValid"):t.addClass("notValid")}});$(".textBoxDateTime").keyup(function(){[8,27].indexOf(event.keyCode)>-1&&$(this).AnyTime_noPicker()});$(".textBoxMulti").each(function(){$(this).height($(this)[0].scrollHeight)});$(".btnMenu").on("click",function(){if(!event.ctrlKey)return showDialog("ChangeModule",this)});$(".calendarImageDiv").on("click","img",function(){var n=$(this).parent().prev(),t=n.attr("onchange");n.attr("onchange","");n.hasClass("textBoxDate")&&n.AnyTime_noPicker().AnyTime_picker({format:"%d/%m/%Y"}).focus();n.hasClass("textBoxTime")&&n.AnyTime_noPicker().AnyTime_picker({format:"%H:%i"}).focus();n.hasClass("textBoxDateTime")&&n.AnyTime_noPicker().AnyTime_picker({format:"%d/%m/%Y %H:%i"}).focus();t!=undefined&&n.attr("onchange",t)});$(".email").on("blur",function(){$(this).val()==""||isValidEmailAddress($(this).val())?$(this).removeClass("notValid"):$(this).addClass("notValid")});window.setTimeout(function(){$(".textBoxMulti").blur(function(){this.style.height="auto";this.style.height=this.scrollHeight+"px"})},1);$(".required").blur(function(){$(this).val()==""?$(this).addClass("notValid"):$(this).removeClass("notValid")});$(".chart").attr("style","width: 100% !important;max-width: 100% !important");$('select[id$="_ddDatePeriod"]').each(function(){$(this).is(":visible")&&showDateFields(this)});$('select[id$="_ddDatePeriod"]').on("change",function(){showDateFields(this)});$(".gvAddTotalRow").each(function(){var t=$(this).attr("id"),n;for(i=0;i<$(this).find("tr:eq(1) td").length;i++)$(this).find("td:eq("+i+")").hasClass("hide")&&$(this).find(".gvTotalRow td:eq("+i+")").addClass("hide"),$(this).find("td:eq("+i+")").hasClass("gvAddTotal")&&$(this).find(".gvTotalRow td:eq("+i+")").html()=="&nbsp;"&&(n=0,$(this).find("tr:gt(0)").find("td:eq("+i+")").each(function(){row_val=Number($(this).html().replace("$","").replace(/,/g,""));isNaN(row_val)||(n+=row_val)}),$(this).find("td:eq("+i+")").html().indexOf("$")!==-1?(n<0?$(this).find(".gvTotalRow td:eq("+i+")").html("-$"+addCommas((-n).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,").toString())):$(this).find(".gvTotalRow td:eq("+i+")").html("$"+addCommas(n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g,"$1,").toString())),$(this).find(".gvTotalRow td:eq("+i+")").css("text-align","right")):($(this).find(".gvTotalRow td:eq("+i+")").html(addCommas(n.toFixed(0).replace(/(\d)(?=(\d{3})+\.)/g,"$1,").toString())),$(this).find(".gvTotalRow td:eq("+i+")").css("text-align","right")))});$(".gvTotalRow td").each(function(){$(this).addClass($(this).closest(".gv").find("tr:eq(1) td:eq("+$(this).index()+")").attr("class"))});$(".gvGoodBad").each(function(){$(this).text().substring(0,1)=="-"?($(this).addClass("bad"),$(this).removeClass("good")):($(this).addClass("good"),$(this).removeClass("bad"))});$("#ddModuleRoleId").each(function(){$("#ddModuleRoleId option").size()==0&&$(this).hide()});$("#userMenu option").length==0?$("#userMenu").hide():($("#btnMenuUser").hover(function(){clearTimeout($(this).data("timeoutId"));$(this).next().find("div").fadeIn("slow")},function(){var n=$(this).next().find("div"),t=setTimeout(function(){n.fadeOut("slow")},2e3);n.data("timeoutId",t)}),$("#userMenu").hover(function(){clearTimeout($(this).data("timeoutId"))},function(){var n=$(this),t=setTimeout(function(){n.fadeOut("slow")},1e3);n.data("timeoutId",t)}));$("#btnMenuUser").on("click",function(n){if(n.preventDefault(),n.ctrlKey&&$("#pnlSessionParameters:hidden"))return $("#pnlSessionParameters").toggle("slow"),!1;__doPostBack("btnMenuUser","")});$("#throbberBackground").on("click").hide();$(".file").hover(function(){$(this).next().fadeIn()},function(){$(this).next().fadeOut()});$(".fileUploadLabel").on("click",function(){$(this).parent("div").fadeOut()});$(window).scroll(function(){$(this).parent("div").hide()});t=$("#ddModuleRoleId option:selected").text();$('div[id$="_RecordDetails_grp"]').each(function(){t=="Admin"&&$(this).find('input[id$="tbCreated"]').val()!=""?$(this).show():$(this).hide()});$(".gvColour").each(function(){$(this).html()!="&nbsp;"&&($(this).css({backgroundColor:"#"+$(this).html()}),$(this).css({color:"#"+$(this).html()}))});$(".textBoxColour").each(function(){$(this).css({backgroundColor:"#"+$(this).val()});$(this).css({color:"#"+$(this).val()})});$(".textBoxColour").on("change",function(){$(this).val($(this).val().replace("#","").substring(0,6));$(this).css({backgroundColor:"#"+$(this).val()});$(this).css({color:"#"+$(this).val()})});$(".textBoxColour").on("click",function(){origColour=$(this).css("backgroundColor");$(".ajax__colorPicker_container div").hover(function(){var n=$(this).closest(".columns").find(".textBoxColour");n.css({backgroundColor:$(this).css("backgroundColor")});n.css({color:$(this).css("backgroundColor")})},function(){var n=$(this).closest(".columns").find(".textBoxColour");n.css({backgroundColor:origColour});n.css({color:origColour})});$(".ajax__colorPicker_container div").on("click",function(){origColour=$(this).closest(".columns").find(".textBoxColour").val()})});$(".singleEntry").on("blur",function(){$(this).addClass("textBoxLabel");$(this).attr("readonly",!0)});$("#menu_nav").hover(function(){$(this).children(".stick").fadeIn("fast").css("display","inline-block")},function(){$(this).children(".stick").fadeOut("fast")});$(".fieldDiv").each(function(){$(this).find(".formField").length==0&&$(this).hide()});CommonSiteScripts();fixTopBar();$(".formField").on("change",function(){$("#lbUnSaved").removeClass("hide");$("#lbUnSaved").fadeIn()});lbUnSavedHidden==!0&&$("#lbUnSaved").hide()}function CommonSiteScripts(){$(".textBoxMobile").mask("999 999 9999");$(".textBoxPhone").mask("(99) 999 9999");$("#tcUser").is(":visible")||$("#pnlLogin").is(":visible")||$(".currentModule").length!==0||$(".btnMenu").first()[0].click()}function fvContent(){var n,t;try{n=$("#fvContent_fvContent_lbContentUId").html();n==""?($("#div_fvContent_fuFileContent").show(),$("#div_fvContent_hlContentURI").hide(),t=$("#fvContent_fvContent_lbLinkedId").html(),t==""?($("#div_fvContent_tbContent").hide(),fvContent_UploadFile()):$("#div_fvContent_tbContent").show()):($("#div_fvContent_fuFileContent").hide(),$("#div_fvContent_hlContentURI").show());$("#fvContent_fvContent_ddCategory option").size()<=2?$("#div_fvContent_ddCategory").hide():$("#div_fvContent_ddCategory").show()}catch(i){error(i,"fvContent")}}function fvContent_pnlButtonBar_btnSaveFile(){try{if(checkForm("#fvContent")==!1)return!1;var n=$("#fvContent_fvContent_lbContentUId").html(),t=$("#fvContent_fvContent_fuFileContent").val();return n==""&&t==""?(dialog("Error","You must select a file to upload."),!1):!0}catch(i){error(i,"fvContent_pnlButtonBar_btnSaveFile")}}function fvContent_pnlButtonBar_btnUploadFile(){try{if(checkForm("#fvContent")==!1)return!1;var n=$("#fvContent_fvContent_fuFileContent").val();return n==""?(dialog("Error","You must select a file to upload."),!1):!0}catch(t){error(t,"fvContent_pnlButtonBar_btnSaveFile")}}function fvContent_pnlButtonBar_btnReplaceFile(){try{return $("#div_fvContent_fuFileContent").show(),!1}catch(n){error(n,"fvContent_pnlButtonBar_btnReplaceFile")}}function fvContent_UploadFile(){try{var n=$("#fvContent_fvContent_lbUploadFile").html();switch(n){case"Example":$("#fvContent_fvContent_ddCategory").addClass("required");$("#fvContent_fvContent_tbContent").removeClass("required");$("#div_fvContent_ddCategory").show();break;case"FEPId":$("#fvContent_fvContent_ddCategory").removeClass("required");$("#div_fvContent_ddCategory").hide();$("#fvContent_fvContent_tbContent").removeClass("required");$("#div_fvContent_tbContent").hide()}}catch(t){error(t,"fvContent_UploadFile")}}function tcBenmoreView_tpCompany_gvCompany(){try{$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_gvCompany tr:gt(0)").each(function(){var n=$(this).find(".TotalShares")||0,t=$(this).find(".PropertyShares")||0,i=$(this).find(".Properties")||0,r=parseInt(n.html())||0,u=parseInt(t.html())||0,f=parseInt(i.html())||0;n.removeClass("badCell");t.removeClass("badCell");i.removeClass("badCell");r!=u&&(n.addClass("badCell"),t.addClass("badCell"))})}catch(n){error(n,"tcBenmoreView_tpCompany_gvCompany")}}function tcBenmoreView_tpCompany_fvCompany(){try{var n=$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvCompany_tcBenmoreView_tpCompany_fvCompany_lbTotalShares"),t=$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvCompany_tcBenmoreView_tpCompany_fvCompany_lbPropertyShares"),r=parseInt(n.html())||0,u=parseInt(t.html())||0;n.val()!=t.val()?(n.addClass("badCell"),t.addClass("badCell")):(n.removeClass("badCell"),t.removeClass("badCell"))}catch(i){error(i,"tcBenmoreView_tpCompany_fvCompany")}}function tcBenmoreView_tpCompany_fvShares_ddTransactionTypeId(){try{var t=$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddTransactionTypeId option:selected").text(),n=$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvCompany_tcBenmoreView_tpCompany_fvCompany_lbCompanyId").html();switch(t){case"Issue":$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddFromCompanyId").val(1);$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddToCompanyId").val(n);break;case"Repurchase":case"Redemption":$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddFromCompanyId").val(n);$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddToCompanyId").val(1);break;case"Transfer":$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddFromCompanyId").val(n);$("#tcBenmoreView_tcBenmoreView_tpCompany_tcBenmoreView_tpCompany_fvShares_tcBenmoreView_tpCompany_fvShares_ddToCompanyId").val("")}}catch(i){error(i,"tcBenmoreView_tpCompany_fvShares_ddTransactionTypeId")}}function tcBenmoreView_tpProperty_fvProperty(){try{var n=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_lbPropertyId").html();(n="")&&$("#tcBenmoreView_tpProperty_fvProperty_WaterDetails_div").hide()}catch(t){error(t,"tcBenmoreView_tpProperty_fvProperty")}}function tcBenmoreView_tpProperty_fvProperty_gvShareDebtor(){var n,t;try{var i=new Date,f=new Date(i.getFullYear(),i.getMonth(),1),r=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_gvShareDebtor tr:last"),u=r.find("td:first");u.html()=="zzzTotal"&&(u.html("Total"),r.addClass("gvTotalRow"));n=!1;t=!1;$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_gvShareDebtor th").each(function(){$(this).text().indexOf("Bdyke")>-1?n=!0:$(this).text().indexOf("Spray")>-1&&(t=!0)});n!=!0?($("#div_tcBenmoreView_tpProperty_fvProperty_btnAddPropertyBorderdyke").hide(),$("#div_tcBenmoreView_tpProperty_fvProperty_btnViewPropertyBorderdyke").hide(),$("#div_tcBenmoreView_tpProperty_fvProperty_tbBorderdykeRate").hide(),$("#div_tcBenmoreView_tpProperty_fvProperty_tbBorderdykeRoster").hide(),$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_gvPropertyWaterUse").find(".Borderdyke").hide()):$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_gvPropertyWaterUse tr:gt(0)").each(function(){var n=$(this).find(".FirstOfMonth").text(),t=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2));if(t>=f)return!1;$(this).find(".MonthlyBorderdykeHours").text().trim()==""&&$(this).find(".Borderdyke").addClass("okCell")});t!=!0&&($("#div_tcBenmoreView_tpProperty_fvProperty_lbSprayRate").hide(),$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvProperty_tcBenmoreView_tpProperty_fvProperty_gvPropertyWaterUse").find(".Spray").hide())}catch(e){error(e,"tcBenmoreView_tpProperty_fvProperty_gvShareDebtor")}}function tcBenmoreView_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave(){var o,s,n,r,u,f;try{var n=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),e=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2)),t=new Date,i=t.getFullYear();if(t.getMonth()<7&&(i=t.getFullYear()-1),o=new Date(i,7,1),s=new Date(i+1,5,1),e<o||e>=s)return showDialog("Error",null,"Error","Date not is current season"),!1;if(n=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),r=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(),n!=""&&r!="")return u=Math.abs(dDate(n)),f=Math.abs(dDate(r)),u<=f?($("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((f-u)/36e4)/10),!0):($("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(""),$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").focus(),showDialog("Error",null,"Error","Finish Time must be after Start Time"),!1)}catch(h){error(h,"tcBenmoreView_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave")}}function tcBenmoreView_tpProperty_fvPropertyBorderdyke_tbHours(){var n,t,i,r;try{n=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val();t=$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val();n!=""&&t!=""&&(i=Math.abs(dDate(n)),r=Math.abs(dDate(t)),i<=r&&$("#tcBenmoreView_tcBenmoreView_tpProperty_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tcBenmoreView_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((r-i)/36e4)/10))}catch(u){error(u,"tcBenmoreView_tpProperty_fvPropertyBorderdyke_tbHours")}}function tcBenmoreView_tpReports(){try{var n=$("#tcBenmoreView_tcBenmoreView_tpReports_tcBenmoreView_tpReports_pnlParameters_ddReport option:selected").text();$("#div_tcBenmoreView_tpReports_pnlParameters_ddDatePeriod").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_ddYear").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_ddQuarter").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_ddFiscalYear").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_ddMonthYear").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_dtFromDate").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_dtToDate").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_dtFromDateTime").hide();$("#div_tcBenmoreView_tpReports_pnlParameters_dtToDateTime").hide();switch(n){case"Variable Charges Report":$("#div_tcBenmoreView_tpReports_pnlParameters_ddDatePeriod").show();showDateFields($("#tcBenmoreView_tcBenmoreView_tpReports_tcBenmoreView_tpReports_pnlParameters_ddDatePeriod")[0]);break;case"Changed Contacts Report":$("#div_tcBenmoreView_tpReports_pnlParameters_dtFromDate").show();$("#div_tcBenmoreView_tpReports_pnlParameters_dtToDate").show()}}catch(t){error(t,"tcBenmoreView_tpReports")}}function tcBenmoreView_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport(){try{$("#tcBenmoreView_tcBenmoreView_tpReports_tcBenmoreView_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport tr:gt(0)").each(function(){var n=$(this).find(".jsRemaining")||0,t=parseInt(n.html())||0;n.parent().removeClass("badCell");t<0&&n.parent().addClass("badCell")})}catch(n){error(n,"tcBenmoreView_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport")}}function tcBenmore_tpCompany_gvCompany(){try{$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_gvCompany tr:gt(0)").each(function(){var n=$(this).find(".TotalShares")||0,t=$(this).find(".PropertyShares")||0,i=$(this).find(".Properties")||0,r=parseInt(n.html())||0,u=parseInt(t.html())||0,f=parseInt(i.html())||0;n.removeClass("badCell");t.removeClass("badCell");i.removeClass("badCell");r!=u&&(n.addClass("badCell"),t.addClass("badCell"))})}catch(n){error(n,"tcBenmore_tpCompany_gvCompany")}}function tcBenmore_tpCompany_fvCompany(){try{var n=$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvCompany_tcBenmore_tpCompany_fvCompany_lbTotalShares"),t=$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvCompany_tcBenmore_tpCompany_fvCompany_lbPropertyShares"),r=parseInt(n.html())||0,u=parseInt(t.html())||0;n.val()!=t.val()?(n.addClass("badCell"),t.addClass("badCell")):(n.removeClass("badCell"),t.removeClass("badCell"))}catch(i){error(i,"tcBenmore_tpCompany_fvCompany")}}function tcBenmore_tpCompany_fvShares_ddTransactionTypeId(){try{var t=$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddTransactionTypeId option:selected").text(),n=$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvCompany_tcBenmore_tpCompany_fvCompany_lbCompanyId").html();switch(t){case"Issue":$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddFromCompanyId").val(1);$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddToCompanyId").val(n);break;case"Repurchase":case"Redemption":$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddFromCompanyId").val(n);$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddToCompanyId").val(1);break;case"Transfer":$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddFromCompanyId").val(n);$("#tcBenmore_tcBenmore_tpCompany_tcBenmore_tpCompany_fvShares_tcBenmore_tpCompany_fvShares_ddToCompanyId").val("")}}catch(i){error(i,"tcBenmore_tpCompany_fvShares_ddTransactionTypeId")}}function tcBenmore_tpProperty_fvProperty(){try{var n=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_lbPropertyId").html();(n="")&&$("#tcBenmore_tpProperty_fvProperty_WaterDetails_div").hide()}catch(t){error(t,"tcBenmore_tpProperty_fvProperty")}}function tcBenmore_tpProperty_fvProperty_gvShareDebtor(){var n,t;try{var i=new Date,f=new Date(i.getFullYear(),i.getMonth(),1),r=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_gvShareDebtor tr:last"),u=r.find("td:first");u.html()=="zzzTotal"&&(u.html("Total"),r.addClass("gvTotalRow"));n=!1;t=!1;$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_gvShareDebtor th").each(function(){$(this).text().indexOf("Bdyke")>-1?n=!0:$(this).text().indexOf("Spray")>-1&&(t=!0)});n!=!0?($("#div_tcBenmore_tpProperty_fvProperty_btnAddPropertyBorderdyke").hide(),$("#div_tcBenmore_tpProperty_fvProperty_btnViewPropertyBorderdyke").hide(),$("#div_tcBenmore_tpProperty_fvProperty_tbBorderdykeRate").hide(),$("#div_tcBenmore_tpProperty_fvProperty_tbBorderdykeRoster").hide(),$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_gvPropertyWaterUse").find(".Borderdyke").hide()):$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_gvPropertyWaterUse tr:gt(0)").each(function(){var n=$(this).find(".FirstOfMonth").text(),t=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2));if(t>=f)return!1;$(this).find(".MonthlyBorderdykeHours").text().trim()==""&&$(this).find(".Borderdyke").addClass("okCell")});t!=!0&&($("#div_tcBenmore_tpProperty_fvProperty_lbSprayRate").hide(),$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvProperty_tcBenmore_tpProperty_fvProperty_gvPropertyWaterUse").find(".Spray").hide())}catch(e){error(e,"tcBenmore_tpProperty_fvProperty_gvShareDebtor")}}function tcBenmore_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave(){var o,s,n,r,u,f;try{var n=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),e=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2)),t=new Date,i=t.getFullYear();if(t.getMonth()<7&&(i=t.getFullYear()-1),o=new Date(i,7,1),s=new Date(i+1,5,1),e<o||e>=s)return showDialog("Error",null,"Error","Date not is current season"),!1;if(n=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),r=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(),n!=""&&r!="")return u=Math.abs(dDate(n)),f=Math.abs(dDate(r)),u<=f?($("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((f-u)/36e4)/10),!0):($("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(""),$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").focus(),showDialog("Error",null,"Error","Finish Time must be after Start Time"),!1)}catch(h){error(h,"tcBenmore_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave")}}function tcBenmore_tpProperty_fvPropertyBorderdyke_tbHours(){var n,t,i,r;try{n=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val();t=$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val();n!=""&&t!=""&&(i=Math.abs(dDate(n)),r=Math.abs(dDate(t)),i<=r&&$("#tcBenmore_tcBenmore_tpProperty_tcBenmore_tpProperty_fvPropertyBorderdyke_tcBenmore_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((r-i)/36e4)/10))}catch(u){error(u,"tcBenmore_tpProperty_fvPropertyBorderdyke_tbHours")}}function tcBenmore_tpReports(){try{var n=$("#tcBenmore_tcBenmore_tpReports_tcBenmore_tpReports_pnlParameters_ddReport option:selected").text();$("#div_tcBenmore_tpReports_pnlParameters_ddDatePeriod").hide();$("#div_tcBenmore_tpReports_pnlParameters_ddYear").hide();$("#div_tcBenmore_tpReports_pnlParameters_ddQuarter").hide();$("#div_tcBenmore_tpReports_pnlParameters_ddFiscalYear").hide();$("#div_tcBenmore_tpReports_pnlParameters_ddMonthYear").hide();$("#div_tcBenmore_tpReports_pnlParameters_dtFromDate").hide();$("#div_tcBenmore_tpReports_pnlParameters_dtToDate").hide();$("#div_tcBenmore_tpReports_pnlParameters_dtFromDateTime").hide();$("#div_tcBenmore_tpReports_pnlParameters_dtToDateTime").hide();switch(n){case"Variable Charges Report":$("#div_tcBenmore_tpReports_pnlParameters_ddDatePeriod").show();showDateFields($("#tcBenmore_tcBenmore_tpReports_tcBenmore_tpReports_pnlParameters_ddDatePeriod")[0]);break;case"Changed Contacts Report":$("#div_tcBenmore_tpReports_pnlParameters_dtFromDate").show();$("#div_tcBenmore_tpReports_pnlParameters_dtToDate").show()}}catch(t){error(t,"tcBenmore_tpReports")}}function tcBenmore_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport(){try{$("#tcBenmore_tcBenmore_tpReports_tcBenmore_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport tr:gt(0)").each(function(){var n=$(this).find(".jsRemaining")||0,t=parseInt(n.html())||0;n.parent().removeClass("badCell");t<0&&n.parent().addClass("badCell")})}catch(n){error(n,"tcBenmore_tpReports_pnlSeasonalUseReport_gvSeasonalUseReport")}}function tcConfiguration_tpCompany_gvCompany(){try{$("#tcConfiguration_tcConfiguration_tpCompany_tcConfiguration_tpCompany_gvCompany tr:gt(0)").each(function(){var t=$(this).find(".TotalShares")||0,n=$(this).find(".PropertyShares")||0,i=$(this).find(".Properties")||0,u=parseInt(t.html())||0,r=parseInt(n.html())||0,f=parseInt(i.html())||0;t.removeClass("badCell");n.removeClass("badCell");i.removeClass("badCell");u!=r&&(t.addClass("badCell"),n.addClass("badCell"));r!=0&&f==0&&(n.addClass("badCell"),i.addClass("badCell"))})}catch(n){error(n,"tcConfiguration_tpCompany_gvCompany")}}function tcShareholder_tpCompany_gvCompany(){try{$("#tcShareholder_tcShareholder_tpCompany_tcShareholder_tpCompany_gvCompany tr:gt(0)").each(function(){var n=$(this).find(".TotalShares")||0,t=$(this).find(".PropertyShares")||0,i=$(this).find(".Properties")||0,r=parseInt(n.html())||0,u=parseInt(t.html())||0,f=parseInt(i.html())||0;n.removeClass("badCell");t.removeClass("badCell");i.removeClass("badCell");r!=u&&(n.addClass("badCell"),t.addClass("badCell"))})}catch(n){error(n,"tcShareholder_tpCompany_gvCompany")}}function tcShareholder_tpCompany_fvCompany(){try{var n=$("#tcShareholder_tcShareholder_tpCompany_tcShareholder_tpCompany_fvCompany_tcShareholder_tpCompany_fvCompany_lbTotalShares"),t=$("#tcShareholder_tcShareholder_tpCompany_tcShareholder_tpCompany_fvCompany_tcShareholder_tpCompany_fvCompany_lbPropertyShares"),r=parseInt(n.html())||0,u=parseInt(t.html())||0;n.val()!=t.val()?(n.addClass("badCell"),t.addClass("badCell")):(n.removeClass("badCell"),t.removeClass("badCell"))}catch(i){error(i,"tcShareholder_tpCompany_fvCompany")}}function tcShareholder_tpProperty_fvProperty(){try{var n=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_lbPropertyId").html();(n="")&&$("#tcShareholder_tpProperty_fvProperty_WaterDetails_div").hide()}catch(t){error(t,"tcShareholder_tpProperty_fvProperty")}}function tcShareholder_tpProperty_fvProperty_gvShareDebtor(){var n,t;try{var i=new Date,f=new Date(i.getFullYear(),i.getMonth(),1),r=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_gvShareDebtor tr:last"),u=r.find("td:first");u.html()=="zzzTotal"&&(u.html("Total"),r.addClass("gvTotalRow"));n=!1;t=!1;$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_gvShareDebtor th").each(function(){$(this).text().indexOf("Bdyke")>-1?n=!0:$(this).text().indexOf("Spray")>-1&&(t=!0)});n!=!0?($("#div_tcShareholder_tpProperty_fvProperty_btnAddPropertyBorderdyke").hide(),$("#div_tcShareholder_tpProperty_fvProperty_btnViewPropertyBorderdyke").hide(),$("#div_tcShareholder_tpProperty_fvProperty_tbBorderdykeRate").hide(),$("#div_tcShareholder_tpProperty_fvProperty_tbBorderdykeRoster").hide(),$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_gvPropertyWaterUse").find(".Borderdyke").hide()):$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_gvPropertyWaterUse tr:gt(0)").each(function(){var n=$(this).find(".FirstOfMonth").text(),t=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2));if(t>=f)return!1;$(this).find(".MonthlyBorderdykeHours").text().trim()==""&&$(this).find(".Borderdyke").addClass("okCell")});t!=!0&&($("#div_tcShareholder_tpProperty_fvProperty_lbSprayRate").hide(),$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvProperty_tcShareholder_tpProperty_fvProperty_gvPropertyWaterUse").find(".Spray").hide())}catch(e){error(e,"tcShareholder_tpProperty_fvProperty_gvShareDebtor")}}function tcShareholder_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave(){var o,s,n,r,u,f;try{var n=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),e=new Date(n.substring(6,10),n.substring(3,5)-1,n.substring(0,2)),t=new Date,i=t.getFullYear();if(t.getMonth()<7&&(i=t.getFullYear()-1),o=new Date(i,7,1),s=new Date(i+1,5,1),e<o||e>=s)return showDialog("Error",null,"Error","Date not is current season"),!1;if(n=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val(),r=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(),n!=""&&r!="")return u=Math.abs(dDate(n)),f=Math.abs(dDate(r)),u<=f?($("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((f-u)/36e4)/10),!0):($("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val(""),$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").focus(),showDialog("Error",null,"Error","Finish Time must be after Start Time"),!1)}catch(h){error(h,"tcShareholder_tpProperty_fvPropertyBorderdyke_pnlButtonBar_btnSave")}}function tcShareholder_tpProperty_fvPropertyBorderdyke_tbHours(){var n,t,i,r;try{n=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtStartDateTime").val();t=$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_dtFinishDateTime").val();n!=""&&t!=""&&(i=Math.abs(dDate(n)),r=Math.abs(dDate(t)),i<=r&&$("#tcShareholder_tcShareholder_tpProperty_tcShareholder_tpProperty_fvPropertyBorderdyke_tcShareholder_tpProperty_fvPropertyBorderdyke_tbHours").val(Math.round((r-i)/36e4)/10))}catch(u){error(u,"tcShareholder_tpProperty_fvPropertyBorderdyke_tbHours")}}function tcUser_tpPerson_fvPassword_pnlButtonBar_btnSavePassword(){try{var t=$("#tcUser_tcUser_tpPerson_tcUser_tpPerson_fvPassword_tcUser_tpPerson_fvPassword_lbEmail").html(),n=$("#tcUser_tcUser_tpPerson_tcUser_tpPerson_fvPassword_tcUser_tpPerson_fvPassword_tbNewPassword").val(),i=$("#tcUser_tcUser_tpPerson_tcUser_tpPerson_fvPassword_tcUser_tpPerson_fvPassword_tbRepeatNewPassword").val();if(n=="")return showDialog("Error",null,"Error","Password must contain at least eight characters, including at least one lowercase letter (a-z), one uppercase letter (A-Z) and one number (0-9)"),!1;if(n!=i)return showDialog("Error",null,"Error","Passwords do not match!"),!1;if(n==t)return showDialog("Error",null,"Error","Password must be different from Username!"),!1;if(n.length<8)return showDialog("Error",null,"Error","Your password is too short  <br/>Password must contain at least eight characters, including at least one lowercase letter (a-z), one uppercase letter (A-Z) and one number (0-9)"),!1;if(re=/[0-9]/,!re.test(n))return showDialog("Error",null,"Error","Your password is missing a number  <br/>Password must contain at least eight characters, including at least one lowercase letter (a-z), one uppercase letter (A-Z) and one number (0-9)"),!1;if(re=/[a-z]/,!re.test(n))return showDialog("Error",null,"Error","Your password is missing a lower case character (a-z)  <br/>Password must contain at least eight characters, including at least one lowercase letter (a-z), one uppercase letter (A-Z) and one number (0-9)"),!1;if(re=/[A-Z]/,!re.test(n))return showDialog("Error",null,"Error","Your password is missing an upper case character (A-Z)  <br/>Password must contain at least eight characters, including at least one lowercase letter (a-z), one uppercase letter (A-Z) and one number (0-9)"),!1;if(checkForm("#tcUser_tcUser_tpPerson_tcUser_tpPerson_fvPerson"))return!0}catch(r){error(r,"tcUser_tpPerson_fvPassword_pnlButtonBar_btnSavePassword")}}var origColour,tbHeight,firstPass=0,lbUnSavedHidden,prevTabIndex;Sys.Application.add_init(AppInit);Date.dateDiff=function(n,t,i){n=n.toLowerCase();var r=i-t;return Math.floor(r/{w:6048e5,d:864e5,h:36e5,n:6e4,s:1e3}[n])};$.fn.animateHighlight=function(n,t){var i=n||"#FFFF9C !important",r=t||1500,u=this.css("backgroundColor");this.stop().css("background-color",i).animate({backgroundColor:u},r)};$.fn.animateBorder=function(n,t){var r=n||"#FFFF9C",u=t||1500,i=this.css("borderColor");this.stop().css("border-color",r).animate({borderTopColor:i,borderLeftColor:i,borderRightColor:i,borderBottomColor:i},u)};$(window).scroll(function(){$(".fileUploadLabel").each(function(){$(this).parent("div").fadeOut("fast")});$("#tbYScroll").val(getPageScroll());var n=0;$(".modal").each(function(){$(this).children(".fv").length>0&&(n=1)});n==0&&fixTopBar()})