1$(function(){function ue(n,t,i){n.tooltip("destroy").attr("title",t).attr("data-placement",i||"bottom").tooltip({trigger:"manual",container:"body",template:'<div class="tooltip val-tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>'}).tooltip("show")}function pu(n){n.tooltip("destroy").removeAttr("title data-placement")}function ti(n,t,i,r,u){var f=$(n);if(f.length){f.validate({rules:t,messages:i,errorPlacement:function(){},showErrors:function(n,t){$.each(this.successList,function(n,t){var i=$(t);i.removeClass("is-invalid");pu(i)});$.each(t,function(n,t){var i=$(t.element),u;i.addClass("is-invalid");u=r[i.attr("name")]||"bottom";ue(i,t.message,u)})},onfocusout:function(n){this.element(n)}});f.on("input change","input, select, textarea",function(){pu($(this))});if(u&&$(u).length)$(u).on("click",function(n){n.preventDefault();f.valid()&&($(this).prop("disabled",!0),f.trigger("submit"))})}}var ai,wu,vr,yr,gr,af,ru,tr,p,kt,ci,ir,lt,ou,rr,su,ur,hu,cu,lu,er,yu;if($.validator.addMethod("businessEmail",function(n,t){var r,i,u;return this.optional(t)?!0:(r=["gmail","yahoo","hotmail","outlook","live","icloud","aol","mail"],i=n.split("@")[1],!i)?!1:(i=i.toLowerCase(),u=i.split(".")[0],!r.includes(u))},"Please use your business email address"),ti("#contactUs",{PersonName:{required:!0,minlength:2},CompanyName:{required:!0,minlength:2},MobileNumber:{required:!0,digits:!0,minlength:10,maxlength:14},EmailAddress:{required:!0,email:!0,businessEmail:!0},ReferenceMenu:{required:!0}},{PersonName:{required:"Please enter your name"},CompanyName:{required:"Please enter your company name"},MobileNumber:{required:"Please enter your mobile number",digits:"Numbers only",minlength:"At least 10 digits",maxlength:"No more than 14 digits"},EmailAddress:{required:"Please enter your email address",email:"Enter a valid email",businessEmail:"Please enter your business email"},ReferenceMenu:{required:"Please tell us how you heard about us"}},{PersonName:"bottom",CompanyName:"bottom",MobileNumber:"bottom",EmailAddress:"bottom",ReferenceMenu:"bottom",TextArea:"bottom"},"#submitContactUs"),ti("#startFreeTrial",{Name:{required:!0,minlength:2},CompanyName:{required:!0,minlength:2},Email:{required:!0,email:!0,businessEmail:!0},Mobile:{required:!0,digits:!0,minlength:10,maxlength:14},ReferenceMenu:{required:!0}},{Name:{required:"Please enter your name"},CompanyName:{required:"Please enter your company name"},Email:{required:"Please enter your email",email:"Enter a valid email",businessEmail:"Please enter your business email"},Mobile:{required:"Please enter your mobile number",digits:"Numbers only",minlength:"At least 10 digits",maxlength:"No more than 14 digits"},ReferenceMenu:{required:"Please tell us how you heard about us"}},{Name:"bottom",CompanyName:"bottom",Email:"bottom",Mobile:"bottom",Message:"bottom",ReferenceMenu:"bottom"},"#submitDemoRequest"),ti("#webinarDetailsForm",{PersonName:{required:!0,minlength:2},CompanyName:{required:!0,minlength:2},MobileNumber:{required:!0,digits:!0,minlength:10,maxlength:14},EmailAddress:{required:!0,email:!0,businessEmail:!0}},{PersonName:{required:"Please enter your name"},CompanyName:{required:"Please enter your company name"},MobileNumber:{required:"Please enter your mobile number",digits:"Numbers only",minlength:"At least 10 digits",maxlength:"No more than 14 digits"},EmailAddress:{required:"Please enter your email",email:"Enter a valid email",businessEmail:"Please enter your business email"}},{PersonName:"bottom",CompanyName:"bottom",MobileNumber:"bottom",EmailAddress:"bottom",ReferenceMenu:"bottom",TextArea:"bottom"},"#submitWebinarRequest"),ti("#DownloadEbook",{PersonName:{required:!0,minlength:2},CompanyName:{required:!0,minlength:2},MobileNumber:{required:!0,digits:!0,minlength:10,maxlength:14},Email:{required:!0,email:!0,businessEmail:!0},EbookId:{required:!0}},{PersonName:{required:"Please enter your name"},CompanyName:{required:"Please enter your company name"},MobileNumber:{required:"Please enter your mobile number",digits:"Numbers only",minlength:"At least 10 digits",maxlength:"No more than 14 digits"},Email:{required:"Please enter your email",email:"Enter a valid email",businessEmail
1:"Please enter your business email"},EbookId:{required:"Please select an ebook before submitting the form."}},{PersonName:"bottom",CompanyName:"bottom",MobileNumber:"bottom",Email:"bottom",Message:"bottom",EbookId:"bottom"},"#submitEbookForm"),ti("#integrationEnquiry",{Name:{required:!0,minlength:2},CompanyName:{required:!0,minlength:2},Email:{required:!0,email:!0,businessEmail:!0},SystemToConnect:{required:!0}},{Name:{required:"Please enter your name"},CompanyName:{required:"Please enter your company name"},Email:{required:"Please enter your email",email:"Enter a valid email",businessEmail:"Please enter your business email"},SystemToConnect:{required:"Please select a system to connect"}},{Name:"bottom",CompanyName:"bottom",Email:"bottom",SystemToConnect:"bottom",Message:"bottom"},"#submitIntegrationEnquiry"),ai=document.getElementById("btnIntegSeeMore"),ai&&ai.addEventListener("click",function(){var n=document.getElementById("integGrid"),t;n&&(t=n.classList.toggle("integ-collapsed"),ai.textContent=t?"See more integrations":"See fewer integrations")}),document.getElementById("roiCalc")){wu=["roiTeam","roiRate","roiHours","roiWeeks","roiRecovery"];function vt(n){var i=document.getElementById(n),t=parseFloat(i.value),r=parseFloat(i.min),u=parseFloat(i.max);return isNaN(t)&&(t=r),t<r&&(t=r),t>u&&(t=u),t}function vi(n){return"£"+Math.round(n).toLocaleString("en-GB")}function yi(){var r=vt("roiTeam"),c=vt("roiRate"),u=vt("roiHours"),f=vt("roiWeeks"),n=vt("roiRecovery"),t=r*c*u*f,e=t*n/100,i;document.getElementById("roiLostYear").textContent=vi(t);document.getElementById("roiLostMonth").textContent=vi(t/12);document.getElementById("roiRecoveryPct").textContent=String(Math.round(n));document.getElementById("roiRecovered").textContent=vi(e);document.getElementById("roiRecoveredFive").textContent=vi(e*5);i=document.getElementById("roiRecoveryBar");i&&(i.style.width=Math.round(n)+"%");var o=r*u*f*n/100,s=document.getElementById("roiHoursRecovered"),h=document.getElementById("roiDaysSaved");s&&(s.textContent=Math.round(o).toLocaleString("en-GB"));h&&(h.textContent=Math.round(o/7.5).toLocaleString("en-GB"))}wu.forEach(function(n){var t=document.getElementById(n),i=document.getElementById(n+"Range");i.addEventListener("input",function(){t.value=i.value;yi()});t.addEventListener("input",yi);t.addEventListener("change",function(){t.value=vt(n);i.value=t.value;yi()})});yi()}if(vr=document.getElementById("calcTabs"),vr&&(yr=vr.getElementsByClassName("roi-tab"),Array.prototype.forEach.call(yr,function(n){n.addEventListener("click",function(){Array.prototype.forEach.call(yr,function(n){n.classList.remove("active");var t=document.getElementById(n.getAttribute("data-panel"));t&&t.classList.add("roi-calc-hidden")});n.classList.add("active");var t=document.getElementById(n.getAttribute("data-panel"));t&&t.classList.remove("roi-calc-hidden")})})),document.getElementById("feeCalc")){function pi(n){var i=document.getElementById(n),t=parseFloat(i.value),r=parseFloat(i.min),u=parseFloat(i.max);return isNaN(t)&&(t=r),t<r&&(t=r),t>u&&(t=u),t}function wi(n){return"£"+n.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}function ii(){var r=document.getElementById("feeMode").value,t=pi("feeCost"),n,i;r==="rate"?(i=pi("feeMargin"),n=t/(1-i/100)):(n=pi("feeRate"),i=(n-t)/n*100);var u=n-t,o=(n-t)/t*100,s=n/t,f=document.getElementById("feeBig"),e=document.getElementById("feeBigLabel");r==="rate"?(f.textContent=wi(n),e.textContent="Charge-out rate to set"):(f.textContent=i.toFixed(1)+"%",e.textContent="Profit margin you make now");document.getElementById("feeProfit").textContent=wi(u);document.getElementById("feeMarkup").textContent=o.toFixed(1)+"%";document.getElementById("feeMarginOut").textContent=i.toFixed(1)+"%";document.getElementById("feeMult").textContent=s.toFixed(2)+"x";document.getElementById("feeInsight").textContent="Bill "+wi(n)+" an hour and "+wi(u)+" of it is profit: a "+i.toFixed(1)+"% margin on every hour sold."}["feeCost","feeMargin","feeRate"].forEach(function(n){var t=document.getElementById(n),i=document.getElementById(n+"Range");i.addEventListener("input",function(){t.value=i.value;ii()});t.addEventListener("input",ii);t.addEventListener("change",function(){t.value=pi(n);i.value=t.value;ii()})});$("#feeMode").on("change",function(){var n=this.value==="rate";document.getElementById("feeMarginField").classList.toggle("roi-field-hidden",!n);document.getElementById("feeRateField").classList.toggle("roi-field-hidden",n);ii()});ii()}if(document.getElementById("demoStage")){var fe=.2,d=[{job:"Riverside Mixed-Use",act:"RIBA Stage 3 coordination",sec:8100,rate:95},{job:"Station Approach",act:"Structural options report",sec:5400,rate:110},{job:"Harbour View",act:"Client design review",sec:2700,rate:85},{job:"Millbrook School",act:"Site visit write-up",sec:0,rate:100}],bu=[{job:"Millbrook School",act:"Variation request call",sec:1200,rate:100},{job:"Riverside Mixed-Use",act:"Contractor query",sec:900,rate:95},{job:"Harbour View",act:"Planning email thread",sec:1500,rate:85},{job:"Station Approach",act:"Drawing mark-up",sec:2100,rate:110},{job:"Millbrook School",act:"Progress note for client",sec:600,rate:100}],ku=0,bi=null,y=-1;function ri(n){return n<10?"0"+n:String(n)}function ki(n){var t=Math.floor(n/3600),i=Math.floor(n%3600/60),r=n%60;return t+":"+ri(i)+":"+ri(r)}function pr(n){var i=Math.floor(n/3600),t=Math.round(n%3600/60);return t===60&&(i+=1,t=0),i+":"+ri(t)}
1function ot(n){return"£"+n.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}function du(n){return ri(n.getDate())+"/"+ri(n.getMonth()+1)+"/"+n.getFullYear()}function ui(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function wr(){var n=0,t=0;return d.forEach(function(i){n+=i.sec;t+=i.sec/3600*i.rate}),{sec:n,fees:t}}function di(){bi&&(clearInterval(bi),bi=null);y=-1}function fi(){var n="";d.forEach(function(t,i){var r=i===y;n+='<div class="demo-row'+(r?" timing":"")+'"><button type="button" class="demo-del" data-del="'+i+'" aria-label="Remove this entry">×<\/button><div class="demo-cell"><div class="job">'+ui(t.job)+'<\/div><div class="act">'+ui(t.act)+'<\/div><\/div><div class="hrs">'+(r?ki(t.sec):pr(t.sec))+'<\/div><button type="button" class="demo-play'+(r?" stop":"")+'" data-play="'+i+'" aria-label="'+(r?"Stop the timer":"Start the timer")+'">'+(r?"■":"▶")+"<\/button><\/div>"});document.getElementById("demoRows").innerHTML=n;document.getElementById("demoTotal").textContent=ki(wr().sec)}function ee(){var n=document.getElementById("demoRows").children;y>-1&&n[y]&&(n[y].getElementsByClassName("hrs")[0].textContent=ki(d[y].sec));document.getElementById("demoTotal").textContent=ki(wr().sec)}document.getElementById("demoRows").addEventListener("click",function(n){var r=n.target.closest?n.target.closest("[data-play]"):null,u=n.target.closest?n.target.closest("[data-del]"):null,i,t;if(r){i=parseInt(r.getAttribute("data-play"),10);y===i?di():(di(),y=i,bi=setInterval(function(){d[y].sec+=1;ee()},1e3));fi();return}if(u){if(t=parseInt(u.getAttribute("data-del"),10),d.length<=1)return;y===t?di():y>t&&(y-=1);d.splice(t,1);fi()}});document.getElementById("demoAddBtn").addEventListener("click",function(){var n=bu[ku%bu.length],i,t;ku+=1;d.push({job:n.job,act:n.act,sec:n.sec,rate:n.rate});fi();i=document.getElementById("demoRows").children;t=i[i.length-1];t&&(t.classList.add("demo-new"),setTimeout(function(){t.classList.remove("demo-new")},900))});function oe(){var i=wr(),n=1,t,r;d.forEach(function(t){t.sec>n&&(n=t.sec)});t="";d.forEach(function(i){t+='<div class="demo-bar-row"><span class="demo-bar-job">'+ui(i.job)+'<\/span><div class="demo-bar"><div data-w="'+Math.max(4,Math.round(i.sec/n*100))+'" style="width:0%"><\/div><\/div><span class="hrs">'+pr(i.sec)+'<\/span><span class="demo-rate">£'+i.rate+"/hr<\/span><\/div>"});document.getElementById("demoRepRows").innerHTML=t;document.getElementById("demoRepHours").textContent=pr(i.sec);document.getElementById("demoRepFees").textContent=ot(i.fees);r=document.getElementById("demoRepRows").querySelectorAll(".demo-bar > div");Array.prototype.forEach.call(r,function(n,t){setTimeout(function(){n.style.width=n.getAttribute("data-w")+"%"},80+t*110)})}function se(){var r="",n=0,t,i,o;d.forEach(function(t){var i=Math.round(t.sec/36)/100,u=Math.round(i*t.rate*100)/100;n+=u;r+='<div class="demo-inv-cols demo-inv-line"><span>'+ui(t.job)+": "+ui(t.act)+'<\/span><span class="num">'+i.toFixed(2)+'<\/span><span class="num">'+ot(t.rate)+'<\/span><span class="num">20.00%<\/span><span class="num">'+ot(u)+"<\/span><\/div>"});document.getElementById("demoInvRows").innerHTML=r;t=Math.round(n*fe*100)/100;i=Math.round((n+t)*100)/100;document.getElementById("demoInvSub").textContent=ot(n);document.getElementById("demoInvVat").textContent=ot(t);document.getElementById("demoInvTot").textContent=ot(i);document.getElementById("demoInvDue").textContent=ot(i);var u=new Date,s=new Date(u.getTime()+2592e6),f=document.getElementById("demoInvDate"),e=document.getElementById("demoInvDue2");f&&(f.textContent=du(u));e&&(e.textContent=du(s));o=document.getElementById("demoInvRows").getElementsByClassName("demo-inv-line");Array.prototype.forEach.call(o,function(n,t){setTimeout(function(){n.classList.add("demo-in")},90+t*130)})}function ei(n){var t,i;for(n>1&&(di(),fi()),t=1;t<=3;t++)document.getElementById("demoPanel"+t).classList.toggle("demo-hidden",t!==n),i=document.getElementById("demoStep"+t),i.classList.toggle("active",t===n),i.classList.toggle("done",t<n);n===2&&oe();n===3&&se()}document.getElementById("demoStep1").addEventListener("click",function(){ei(1)});document.getElementById("demoStep2").addEventListener("click",function(){ei(2)});document.getElementById("demoStep3").addEventListener("click",function(){ei(3)});document.getElementById("demoNext1").addEventListener("click",function(){ei(2)});document.getElementById("demoNext2").addEventListener("click",function(){ei(3)});fi()}if(document.getElementById("hrsTool")){var yt="day",nt=document.getElementById("hrsDayRows"),he=document.getElementById("hrsWeekRows"),ce=["Monday","Tuesday","Wednesday","Thursday","Frid
1ay","Saturday","Sunday"],gu=4,nf=1,br=null;function kr(n){return(n<10?"0":"")+n}function g(n){var t,f,i,u,r;if(n===null||n===undefined||(t=String(n).toLowerCase().replace(/\s+/g,""),t===""))return null;if(t==="noon"||t==="midday"||t==="12noon")return 720;if(t==="midnight"||t==="12midnight")return 0;if(f="",/a\.?m\.?$/.test(t)?(f="am",t=t.replace(/a\.?m\.?$/,"")):/p\.?m\.?$/.test(t)&&(f="pm",t=t.replace(/p\.?m\.?$/,"")),t=t.replace(/[^0-9:.]/g,"").replace(/\./g,":"),r=/^(\d{1,2}):(\d{1,2})$/.exec(t))i=parseInt(r[1],10),u=parseInt(r[2],10);else if(r=/^(\d{1,2})$/.exec(t))i=parseInt(r[1],10),u=0;else if(r=/^(\d)(\d{2})$/.exec(t))i=parseInt(r[1],10),u=parseInt(r[2],10);else if(r=/^(\d{2})(\d{2})$/.exec(t))i=parseInt(r[1],10),u=parseInt(r[2],10);else return null;if(isNaN(i)||isNaN(u)||u>59||i>24)return null;if(f==="am")if(i===12)i=0;else if(i>12)return null;if(f==="pm")if(i<12)i+=12;else if(i>12)return null;return i===24?u===0?1440:null:i*60+u}function pt(n){return kr(Math.floor(n/60))+":"+kr(n%60)}function st(n){return Math.floor(n/60)+"h "+kr(n%60)+"m"}function oi(n){return(n/60).toFixed(2)}function dr(n){return Math.round(n).toLocaleString("en-GB")}function tf(n){return"£"+n.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}function gi(n){var t=Math.floor(n/60),i=n%60;return n===0?"zero hours":i===0?t+(t===1?" hour":" hours"):t===0?i+(i===1?" minute":" minutes"):t+(t===1?" hour ":" hours ")+i+(i===1?" minute":" minutes")}function le(n){if(n===0)return"None";var t=Math.abs(n);return(n>0?"+":"-")+(t<60?t+" min":st(t))}function ae(n,t,i){if(n<=0)return 0;if(t<=1)return n;var r=n/t;return i==="up"?Math.ceil(r)*t:i==="down"?Math.floor(r)*t:Math.round(r)*t}function b(n,t){var i=document.getElementById(n);i&&i.classList.toggle("hrs-off",!!t)}function h(n,t){var i=document.getElementById(n);i&&(i.textContent=t)}function rf(){var n=parseInt(document.getElementById("hrsRound").value,10);return isNaN(n)?1:n}function uf(){var n=parseFloat(document.getElementById("hrsRate").value);return isNaN(n)||n<0?0:n>1e3?1e3:n}function ve(n,t,i){var r={valid:!1,half:!1,span:0,brk:0,net:0,rnd:0,overnight:!1,tooLong:!1,same:!1,start:0},h=document.getElementById(n+"From"),c=document.getElementById(n+"To"),l=document.getElementById(n+"Break"),e,s,u,f,o;return!h||!c?r:(e=g(h.value),s=g(c.value),e===1440&&(e=0),u=parseInt(l?l.value:"0",10),(isNaN(u)||u<0)&&(u=0),u>1440&&(u=1440),r.brk=u,e===null&&s===null)?r:e===null||s===null?(r.half=!0,r):(r.valid=!0,r.start=e,f=s-e,f<0&&(f+=1440,r.overnight=!0),r.span=f,r.same=f===0,r.tooLong=u>f&&f>0,o=f-u,o<0&&(o=0),r.net=o,r.rnd=ae(o,t,i),r)}function ye(){var t=[],n,i;if(yt==="day")for(i=nt.getElementsByClassName("hrs-row"),n=0;n<i.length;n++)t.push(i[n].getAttribute("data-hrs-pre"));else for(n=1;n<=7;n++)t.push("hrsW"+n);return t}function c(){var k=rf(),ot=document.getElementById("hrsRoundDir"),bt=ot.value,ut,nt,tt,l,w,it,ft,e,rt,vt,v,et,wt;ot.disabled=k<=1;for(var d=ye(),g=0,n=0,ht=0,i=0,y=[],f=[],u=null,ct=!1,lt=!1,s,o=0;o<d.length;o++){var t=ve(d[o],k,bt),kt=yt==="day"?"Range "+(o+1):ce[o],a="",at="";t.half?(y.push(kt),a="needs both times"):t.valid&&(g+=t.net,n+=t.rnd,ht+=t.brk,i+=1,i===1&&(u=t),f.push({i:o+1,a:t.start,b:t.start+t.span}),t.tooLong?(ct=!0,a="break too long"):t.same?(lt=!0,a="same time"):t.overnight&&(a="next day"),at="<b>"+oi(t.rnd)+"<\/b><i>"+st(t.rnd)+"<\/i>");ut=document.getElementById(d[o]+"Out");ut&&(ut.innerHTML=at);nt=document.getElementById(d[o]+"Flag");nt&&(nt.textContent=a,nt.classList.toggle("hrs-off",a===""))}if(tt="",yt==="day"&&f.length>1)for(f.sort(function(n,t){return n.a-t.a}),s=1;s<f.length;s++)if(f[s].a<f[s-1].b){tt="Ranges "+Math.min(f[s-1].i,f[s].i)+" and "+Math.max(f[s-1].i,f[s].i)+" overlap, so some minutes are counted twice.";break}var c=n-g,p=uf(),r=yt==="week";h("hrsBig",st(n));h("hrsBigCap",r?"Total worked that week, after breaks":"Total worked that day, after breaks");h("hrsDecimal",oi(n));h("hrsMinutes",dr(n));h("hrsExact",st(g));b("hrsExactRow",k<=1);h("hrsDrift",le(c));h("hrsBreakOut",st(ht));h("hrsCountLabel",r?"Days worked":"Time ranges counted");h("hrsCount",String(i));b("hrsAvgRow",!r||i===0);r&&i>0&&h("hrsAvg",st(Math.round(n/i)));b("hrsPayRow",p<=0);p>0&&(h("hrsPayLabel",r?"Pay for the week":"Pay for the day"),h("hrsPay",tf(n/60*p)));b("hrsTargetRow",!r);b("hrsBarRow",!r);b("hrsBarWrap",!r);r&&(l=parseFloat(document.getElementById("hrsTarget").value),(isNaN(l)||l<0)&&(l=0),l>80&&(l=80),w=Math.round(l*60),it=n-w,h("hrsTargetOut",w===0?"No standard set":it===0?"On target":st(Math.abs(it))+(it>
10?" over":" under")),ft=w>0?Math.round(n/w*100):0,h("hrsBarPct",ft+"%"),document.getElementById("hrsBarFill").style.width=Math.min(100,ft)+"%");e="";i===0&&y.length===0?e="Enter a start time and a finish time to see your hours.":y.length>0?e=y.join(", ")+(y.length>1?" need ":" needs ")+"both a start and a finish time.":ct?e="One or more rows have a break longer than the time between the two times, so those rows count as 0h 00m.":lt?e="A start and a finish are the same, so that row counts as 0h 00m. For a full 24 hours enter 00:00 to 24:00.":tt?e=tt:!r&&g>1440?e="That is more than 24 hours in one day. Check for time ranges that overlap.":r&&n>2880&&(e="That is more than 48 hours. UK working time rules use a 48 hour average across 17 weeks, and a worker can agree in writing to opt out. General information, not legal advice.");h("hrsWarn",e);b("hrsWarn",e==="");k<=1?rt="Worked out in your browser. Nothing you type is saved or sent anywhere.":c===0?rt="Your rounding rule costs nothing on these entries. Set the direction to Always down to see what a one way rule does.":(vt=(c<0?" off ":" to ")+(r?"this week":"this day"),rt="Rounding "+(c<0?"takes ":"adds ")+Math.abs(c)+(Math.abs(c)===1?" minute":" minutes")+vt+(p>0?", worth "+tf(Math.abs(c)/60*p)+".":". Add an hourly rate to see what that is worth."));h("hrsNote",rt);i===0?v="Put a start time and a finish time in the boxes to see your hours.":r?v="<b>"+i+(i===1?" day<\/b> adds":" days<\/b> add")+" up to <b>"+gi(n)+"<\/b>, which is <b>"+oi(n)+"<\/b> decimal hours, an average of <b>"+gi(Math.round(n/i))+"<\/b> a day.":i===1&&u?(et=u.start+u.span,wt=et===1440?"24:00":pt(et%1440),v="<b>"+pt(u.start)+"<\/b> to <b>"+wt+"<\/b>"+(u.brk>0?" with a <b>"+u.brk+" minute<\/b> unpaid break":"")+" is <b>"+gi(u.rnd)+"<\/b>, which is <b>"+oi(u.rnd)+"<\/b> decimal hours, or <b>"+dr(u.rnd)+"<\/b> minutes."+(u.overnight?" This shift runs past midnight and finishes the next day.":"")):v="<b>"+i+" time ranges<\/b> add up to <b>"+gi(n)+"<\/b>, which is <b>"+oi(n)+"<\/b> decimal hours, or <b>"+dr(n)+"<\/b> minutes.";br&&clearTimeout(br);br=setTimeout(function(){var n=document.getElementById("hrsLiveAnswer"),t=document.getElementById("hrsHeroAnswer");n&&(n.innerHTML=v);t&&(t.innerHTML=v);pe()},400)}function pe(){var t,i,n,u,f;if(window.history&&window.history.replaceState){if(t=window.location.pathname,i=nt.getElementsByClassName("hrs-row"),yt!=="day"||i.length!==1){window.history.replaceState(null,"",t);return}var r=i[0].getAttribute("data-hrs-pre"),e=document.getElementById(r+"From").value,o=document.getElementById(r+"To").value;g(e)!==null&&g(o)!==null&&(n="?from="+encodeURIComponent(e)+"&to="+encodeURIComponent(o)+"&break="+encodeURIComponent(document.getElementById(r+"Break").value||"0"),u=rf(),u>1&&(n+="&round="+u+"&dir="+encodeURIComponent(document.getElementById("hrsRoundDir").value)),f=uf(),f>0&&(n+="&rate="+f),window.history.replaceState(null,"",t+n))}}function wt(n){var t=new RegExp("[?&]"+n+"=([^&#]*)").exec(window.location.search);return t?decodeURIComponent(t[1].replace(/\+/g," ")):null}function we(n){if(n.value===""){n.classList.remove("hrs-bad");return}var t=g(n.value);if(t===null){n.classList.add("hrs-bad");return}n.classList.remove("hrs-bad");t===1440&&n.getAttribute("data-hrs-end")!=="1"&&(t=0);n.value=t===1440?"24:00":pt(t)}function nr(){for(var t=nt.getElementsByClassName("hrs-row"),i,r,n=0;n<t.length;n++)i=t[n].getElementsByClassName("hrs-daylabel")[0],i&&(i.textContent="Range "+(n+1)),r=t[n].getElementsByClassName("hrs-del")[0],r&&r.classList.toggle("hrs-off",t.length<=1);document.getElementById("hrsAddRange").classList.toggle("hrs-off",t.length>=gu)}function ff(n){n&&(n.addEventListener("input",function(n){var t=n.target;t&&t.classList&&t.classList.contains("hrs-in")&&c()}),n.addEventListener("change",function(n){var t=n.target,i;t&&t.classList&&(t.classList.contains("hrs-time")&&we(t),t.classList.contains("hrs-brk")&&t.value!==""&&(i=parseInt(t.value,10),(isNaN(i)||i<0)&&(i=0),i>1440&&(i=1440),t.value=i),c())}),n.addEventListener("keydown",function(n){var t=n.target,r,i;if(t&&t.classList&&t.classList.contains("hrs-in")){if(n.keyCode===13){n.preventDefault();c();t.blur();r=document.getElementById("hrsBig");r&&r.focus&&r.focus();return}t.classList.contains("hrs-time")&&(n.keyCode===38||n.keyCode===40)&&
1(i=g(t.value),i!==null)&&(i+=(n.keyCode===38?1:-1)*(n.shiftKey?60:15),i=(i%1440+1440)%1440,t.value=pt(i),t.classList.remove("hrs-bad"),n.preventDefault(),c())}}),n.addEventListener("click",function(n){var i=n.target,r,t;if(i&&i.classList&&i.classList.contains("hrs-del")&&(r=nt.getElementsByClassName("hrs-row"),!(r.length<=1))){for(t=i.parentNode;t&&(!t.classList||!t.classList.contains("hrs-row"));)t=t.parentNode;t&&t.parentNode&&t.parentNode.removeChild(t);nr();c()}}))}function ef(n){yt=n;var t=n==="week",i=document.getElementById("hrsTabs").getElementsByClassName("roi-tab");Array.prototype.forEach.call(i,function(t){var i=t.getAttribute("data-hrs-mode")===n,r;t.classList.toggle("active",i);t.setAttribute("aria-selected",i?"true":"false");r=document.getElementById(t.getAttribute("data-panel"));r&&r.classList.toggle("roi-calc-hidden",!i)});b("hrsFillWeek",!t);b("hrsClearWeek",!t);b("hrsTargetField",!t)}function sf(n,t,i){for(var r=nt.getElementsByClassName("hrs-row");r.length>1;)nt.removeChild(r[r.length-1]);var u=r[0].getAttribute("data-hrs-pre"),f=document.getElementById(u+"From"),e=document.getElementById(u+"To");f.value=n;e.value=t;document.getElementById(u+"Break").value=i;f.classList.remove("hrs-bad");e.classList.remove("hrs-bad");ef("day");nr();c()}function hf(n,t){for(var i=t;i&&i!==n&&(!i.getAttribute||i.getAttribute("data-hrs-from")===null);)i=i.parentNode;return!i||i===n||!i.getAttribute||i.getAttribute("data-hrs-from")===null?!1:(sf(i.getAttribute("data-hrs-from"),i.getAttribute("data-hrs-to"),i.getAttribute("data-hrs-brk")),!0)}document.getElementById("hrsPresets").addEventListener("click",function(n){hf(this,n.target)});gr=document.getElementById("hrsAnswers");gr&&gr.addEventListener("click",function(n){if(hf(this,n.target)){var t=document.getElementById("hours-worked-tool");t&&t.scrollIntoView&&t.scrollIntoView({behavior:"smooth",block:"start"})}});Array.prototype.forEach.call(document.getElementById("hrsTabs").getElementsByClassName("roi-tab"),function(n){n.addEventListener("click",function(){ef(n.getAttribute("data-hrs-mode"));c()})});document.getElementById("hrsAddRange").addEventListener("click",function(){var r=nt.getElementsByClassName("hrs-row"),i;if(!(r.length>=gu)){nf+=1;var n="hrsD"+nf,u=' inputmode="numeric" autocomplete="off" autocapitalize="off" autocorrect="off" spellcheck="false" maxlength="8" value=""',t=document.createElement("div");t.className="hrs-row";t.setAttribute("data-hrs-pre",n);t.innerHTML='<div class="hrs-daylabel">Range '+(r.length+1)+'<\/div><div class="hrs-cell hrs-c-start"><label for="'+n+'From">Start<\/label><input class="hrs-in hrs-time" id="'+n+'From"'+u+' /><\/div><div class="hrs-cell hrs-c-end"><label for="'+n+'To">Finish<\/label><input class="hrs-in hrs-time" id="'+n+'To" data-hrs-end="1"'+u+' /><\/div><div class="hrs-cell hrs-c-brk"><label for="'+n+'Break">Unpaid break (min)<\/label><input class="hrs-in hrs-brk" id="'+n+'Break" type="number" inputmode="numeric" min="0" max="1440" step="5" value="0" /><\/div><div class="hrs-out" id="'+n+'Out"><\/div><button type="button" class="hrs-del" aria-label="Remove this time range">×<\/button><div class="hrs-flag hrs-off" id="'+n+'Flag"><\/div>';nt.appendChild(t);nr();c();i=document.getElementById(n+"From");i&&i.focus()}});document.getElementById("hrsFillWeek").addEventListener("click",function(){var t=document.getElementById("hrsW1From").value,i=document.getElementById("hrsW1To").value,r=document.getElementById("hrsW1Break").value,n;if(g(t)===null||g(i)===null){h("hrsWarn","Fill in Monday first, then copy it across.");b("hrsWarn",!1);return}for(n=2;n<=5;n++)document.getElementById("hrsW"+n+"From").value=t,document.getElementById("hrsW"+n+"To").value=i,document.getElementById("hrsW"+n+"Break").value=r,document.getElementById("hrsW"+n+"From").classList.remove("hrs-bad"),document.getElementById("hrsW"+n+"To").classList.remove("hrs-bad");c()});document.getElementById("hrsClearWeek").addEventListener("click",function(){for(var n=1;n<=7;n++)document.getElementById("hrsW"+n+"From").value="",document.getElementById("hrsW"+n+"To").value="",document.getElementById("hrsW"+n+"Break").value="",document.getElementById("hrsW"+n+"From").classList.remove("hrs-bad"),document.getElementById("hrsW"+n+"To").classList.remove("hrs-bad");c()});document.getElementById("hrsResetTool").addEventListener("click",function(){document.getElementById("hrsRound").value="1";document.getElementById("hrsRoundDir").value="near";document.getElementById("hrsRate").value="";document.getElementById("hrsTarget").value="37.5";sf("09:00","17:00","30")});function cf(n,t){var i=document.createElement("textarea");i.value=n;i.setAttribute("readonly","readonly");i.style.position="fixed";i.style.top="-1000px";document.body.appendChild(i);i.select();try{document.execCommand("copy");t()}catch(r){}document.body.removeChild(i)}
1function lf(n,t,i){var r=function(){t.textContent="Copied";t.classList.add("hrs-copied");setTimeout(function(){t.textContent=i;t.classList.remove("hrs-copied")},1600)};try{if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(n).then(r,function(){cf(n,r)});return}}catch(u){}cf(n,r)}document.getElementById("hrsCopy").addEventListener("click",function(){lf(document.getElementById("hrsLiveAnswer").textContent+" Worked out at quantim.co.uk/hours-worked-calculator",this,"Copy the answer")});document.getElementById("hrsShare").addEventListener("click",function(){lf(window.location.href,this,"Copy the link")});navigator.clipboard&&navigator.clipboard.writeText||document.execCommand||(document.getElementById("hrsCopy").classList.add("hrs-off"),document.getElementById("hrsShare").classList.add("hrs-off"));$("#hrsRound").on("change",c);$("#hrsRoundDir").on("change",c);document.getElementById("hrsRate").addEventListener("input",c);document.getElementById("hrsRate").addEventListener("change",function(){var n=parseFloat(this.value);isNaN(n)||(this.value=n<0?0:n>1e3?1e3:n);c()});document.getElementById("hrsTarget").addEventListener("input",c);document.getElementById("hrsTarget").addEventListener("change",function(){var n=parseFloat(this.value);isNaN(n)&&(n=0);this.value=n<0?0:n>80?80:n;c()}),function(){var f=wt("from"),e=wt("to"),r=wt("break"),t=wt("round"),i=wt("dir"),u=wt("rate"),n;f!==null&&(n=g(f))!==null&&(document.getElementById("hrsD1From").value=pt(n===1440?0:n));e!==null&&(n=g(e))!==null&&(document.getElementById("hrsD1To").value=n===1440?"24:00":pt(n));r!==null&&/^\d{1,4}$/.test(r)&&(document.getElementById("hrsD1Break").value=Math.min(1440,parseInt(r,10)));(t==="1"||t==="6"||t==="15"||t==="30")&&(document.getElementById("hrsRound").value=t);(i==="near"||i==="up"||i==="down")&&(document.getElementById("hrsRoundDir").value=i);u!==null&&/^\d{1,4}(\.\d{1,2})?$/.test(u)&&(document.getElementById("hrsRate").value=Math.min(1e3,parseFloat(u)))}();ff(nt);ff(he);nr();c()}if(document.getElementById("utilCalc")){af=["utilCurrent","utilTarget","utilGoal","utilTeam","utilHours","utilWeeks","utilRate","utilReal","utilFixed"];function k(n){var i=document.getElementById(n),t=parseFloat(i.value),r=parseFloat(i.min),u=parseFloat(i.max);return isNaN(t)?r:t<r?r:t>u?u:t}function nu(n){return!isFinite(n)||n<0?0:n>=1e4?Math.round(n/100)*100:n>=1e3?Math.round(n/10)*10:Math.round(n)}function tt(n){return"£"+nu(n).toLocaleString("en-GB")}function si(n){return"£"+n.toLocaleString("en-GB")}function vf(n){return(!isFinite(n)||n<0)&&(n=0),Math.round(n).toLocaleString("en-GB")}function o(n){(!isFinite(n)||n<0)&&(n=0);var r=Math.round(n*60),i=Math.floor(r/60),t=r%60;return i===0?t+"m":t===0?i+"h":i+"h "+(t<10?"0"+t:t)+"m"}function f(n){(!isFinite(n)||n<0)&&(n=0);var t=n.toFixed(1);return t.substr(t.length-2)===".0"&&(t=t.substr(0,t.length-2)),t}function ht(n){return f(n)+" wks"}function u(n,t){var i=document.getElementById(n);i&&(i.textContent=t)}function yf(n,t){var i=document.getElementById(n);i&&i.classList.toggle("hrs-off",!!t)}function tu(n){return!isFinite(n)||n<0?0:n>100?100:n}function rt(n,t,i){var r=document.getElementById(n),u;r&&(u=tu(t),r.style.width=u.toFixed(2)+"%",r.textContent=u>=12?i:"")}function pf(n,t){var i=document.getElementById(n);i&&(i.style.left="calc("+tu(t).toFixed(2)+"% - 1px)")}function iu(n,t){var i=document.getElementById(n);i&&i.setAttribute("aria-label",t)}function bt(){var oi=document.getElementById("utilMode").value,yt=oi==="plan",st=k("utilTeam"),t=k("utilHours"),c=k("utilWeeks"),g=k("utilRate"),w=k("utilReal")/100,ft=k("utilFixed"),n=k("utilCurrent")/100,ct=k("utilGoal"),lt=t*c,et=st*lt,gt=et*g*w,i=t>0?1-ft/t:0,s,at,vt,fi,nt,d,v,it,l,a,ut,ei,y,p,h,bt,kt,dt;i<0&&(i=0);var pt=yt?gt>0?n+ct/gt:n:k("utilTarget")/100,r=yt&&pt>1,e=pt;e<n&&(e=n);e>1&&(e=1);s=e-n;s<0&&(s=0);var ot=et*s,hi=et*n*g*w,ni=ot*g*w,ci=ot*g,li=ni/12,ti=et*g*w*.01,ii=t*s/5,ai=t*s,ri=lt>0?ot/lt:0,ui=et*(1-n)*g*w,wt=(pt-n)*100,b="n/a";r?(u("utilBig","Not reachable"),u("utilBigCap","That goal needs "+f(wt)+" points, taking utilisation past 100%")):(u("utilBig",vf(ot)+" hours"),yt?u("utilBigCap","Chargeable hours needed to add "+tt(ct)+" a year, a "+f(s*100)+" point move to "+f(e*100)+"%"):s===0?u("utilBigCap","No gap at this target"):u("utilBigCap","Chargeable hours a "+f(s*100)+" point move adds, a year"));at=nu(hi);vt=nu(ni);u("utilRowNowPct",f(n*100));u("utilFeeNow",si(at));u("utilRowTgtPct",r?f(100):f(e*100));u("utilFeeTarget",r?b:si(at+vt));u("utilGapYear",r?b:si(vt));u("utilRealPct",f(w*100));u("utilGapCard",r?b:tt(ci));yf("utilGapCardRow",w>=1);
1u("utilGapMonth",r?b:tt(li));u("utilPerDay",r?b:o(ii)+" a day");u("utilPerWeek",r?b:o(ai)+" a week");u("utilFte",r?b:(isFinite(ri)?ri.toFixed(2):"0.00")+" of a fee earner");u("utilPoint",tt(ti)+" a point");fi=tu(n*100);document.getElementById("utilBarFill").style.width=fi.toFixed(2)+"%";u("utilBarNow",f(n*100)+"%");u("utilBarCeil",(i*100).toFixed(1)+"%");pf("utilBarMark",i*100);nt=Math.round(c*n*10)/10;d=Math.round(c*10)/10-nt;d<0&&(d=0);v=Math.round((52-c)*10)/10;v<0&&(v=0);it=nt+d+v;it<=0&&(it=1);rt("utilYrCharge",nt/it*100,ht(nt));rt("utilYrInt",d/it*100,ht(d));rt("utilYrLeave",v/it*100,ht(v));u("utilYearNote",lt.toLocaleString("en-GB")+" hours at work in "+f(c)+" chargeable weeks"+(c>=52?", with no leave allowed for":""));iu("utilYearWrap","Your year per person: "+ht(nt)+" chargeable, "+ht(d)+" internal and "+ht(v)+" of leave.");l=Math.round(t*60);l<=0&&(l=1);a=Math.round(t*n*60);ut=l-a;ut<0&&(ut=0);rt("utilNowCharge",a/l*100,o(a/60));rt("utilNowInt",ut/l*100,o(ut/60));u("utilWeekNote",o(t)+" contracted");iu("utilNowWrap","Your week now: "+o(a/60)+" chargeable and "+o(ut/60)+" internal.");ei=r?1:e;y=Math.round(t*(ei-n)*60);y<0&&(y=0);p=l-a-y;p<0&&(p=0);rt("utilTgtCharge",a/l*100,o(a/60));rt("utilTgtMove",y/l*100,"+"+o(y/60));rt("utilTgtInt",p/l*100,o(p/60));u("utilCeilNote","Practical ceiling "+(i*100).toFixed(1)+"%");pf("utilCeilLine",i*100);iu("utilTgtWrap","Your week at target: "+o(a/60)+" already chargeable, "+o(y/60)+" more, and "+o(p/60)+" left internal, against a practical ceiling of "+(i*100).toFixed(1)+" per cent.");u("utilKeyCharge",o(a/60));u("utilKeyMove","+"+o(y/60));u("utilKeyInt",o(p/60));u("utilKeyLeave",ht(v));u("utilKeyCeil",(i*100).toFixed(1)+"%");h="";ft>=t?h="Fixed internal hours are at or above the contracted week, so the practical ceiling reads 0%. Check that input before reading anything below it.":r?h="Adding "+tt(ct)+" a year would take "+f(wt)+" percentage points. Even at one hundred per cent utilisation this team could add at most "+tt(ui)+" a year, so that figure is a headcount, rate or realisation question rather than a utilisation one.":n>i?h="Your current utilisation of "+f(n*100)+"% is already above your own practical ceiling of "+(i*100).toFixed(1)+"%. Either the internal load is lower than the "+f(ft)+" hours entered, the hours are coming out of overtime, or your own report uses a different denominator to this one.":e>=1?h="A target of one hundred per cent leaves nothing at all for bids, admin, CPD, management or QA. There is an optimum utilisation, not a maximum.":e>i?h="A target of "+f(e*100)+"% sits above your practical ceiling of "+(i*100).toFixed(1)+"%, because "+f(ft)+" fixed internal hours in a "+o(t)+" week have to live somewhere. The figures below still compute, but no amount of sold work reaches a target above that line.":s===0?h="The target is at or below your current utilisation, so there is no gap to size. Raise the target to see what a move would be worth.":c>=52?h="Fifty two chargeable weeks allows for no annual leave or bank holidays at all. Statutory minimum leave in the UK is 5.6 weeks, so the figures below are the optimistic version.":ft===0&&(h="With no fixed internal hours the practical ceiling is 100%. Very few practices have no standing internal commitments, so the gap below is the optimistic version.");u("utilWarn",h);yf("utilWarn",h==="");bt=r?"Adding <b>"+tt(ct)+"<\/b> a year would take <b>"+f(wt)+" percentage points<\/b> of utilisation, which is more than the week contains. At <b>"+f(st)+"<\/b> fee earners on <b>"+o(t)+"<\/b> a week over <b>"+f(c)+"<\/b> chargeable weeks, the most this team could add even at one hundred per cent is <b>"+tt(ui)+"<\/b> a year.":s===0?"At <b>"+f(st)+"<\/b> fee earners on <b>"+o(t)+"<\/b> a week over <b>"+f(c)+"<\/b> chargeable weeks, <b>"+f(n*100)+"%<\/b> utilisation is worth <b>"+si(at)+"<\/b> a year invoiced, and one percentage point is worth <b>"+tt(ti)+"<\/b>. Set a target above your current rate to size a gap.":"At <b>"+f(st)+"<\/b> fee earners on <b>"+o(t)+"<\/b> a week over <b>"+f(c)+"<\/b> chargeable weeks, moving from <b>"+f(n*100)+"%<\/b> to <b>"+f(e*100)+"%<\/b> takes <b>"+o(ii)+"<\/b> more chargeable time per person per day and leaves <b>
1"+o(p/60)+"<\/b> a week each for bids, admin, CPD and management. That is <b>"+vf(ot)+"<\/b> more chargeable hours a year, worth about <b>"+si(vt)+"<\/b>, and only if the work exists to fill them, they are charged at the rate you entered, and they are invoiced and paid.";kt=document.getElementById("utilLiveAnswer");dt=document.getElementById("utilHeroAnswer");kt&&(kt.innerHTML=bt);dt&&(dt.innerHTML=bt)}af.forEach(function(n){var t=document.getElementById(n),i=document.getElementById(n+"Range");t&&i&&(i.addEventListener("input",function(){t.value=i.value;bt()}),t.addEventListener("input",bt),t.addEventListener("change",function(){var r=k(n);t.value=r;i.value=r;bt()}))});$("#utilMode").on("change",function(){var n=this.value==="plan";document.getElementById("utilTargetField").classList.toggle("roi-field-hidden",n);document.getElementById("utilGoalField").classList.toggle("roi-field-hidden",!n);bt()});document.getElementById("utilPresets").addEventListener("click",function(n){for(var t=n.target,r,i,u,f,e;t&&t!==this&&(!t.getAttribute||t.getAttribute("data-util-weeks")===null);)t=t.parentNode;if(t&&t!==this&&t.getAttribute){r={utilTeam:"data-util-team",utilHours:"data-util-hours",utilWeeks:"data-util-weeks"};for(i in r)r.hasOwnProperty(i)&&(u=t.getAttribute(r[i]),u!==null)&&(f=document.getElementById(i),f.value=u,e=k(i),f.value=e,document.getElementById(i+"Range").value=e);bt()}});bt()}if(document.getElementById("otCalc")){function it(n){var t=parseFloat(n);return isNaN(t)?0:t}function i(n){return!isFinite(n)||isNaN(n)?"£0.00":"£"+n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")}function be(){var n=$("#otMultiplier").val();return n==="custom"?it(document.getElementById("otCustomMul").value):it(n)}function ke(){var n=$("#otEnhancedMul").val();return n==="custom"?it(document.getElementById("otEnhancedCustomMul").value):it(n)}function hi(){var n=it(document.getElementById("otRate").value),c=it(document.getElementById("otHours").value),r=it(document.getElementById("otOvertimeHrs").value),p=be(),t=it(document.getElementById("otEnhancedHrs").value),w=ke(),u=it(document.getElementById("otWeeksYear").value)||45,l=c*n,rt=n*p,f=r*rt,ut=n*w,e=t*ut,s=l+f+e,o=c+r+t,ft=o>0?s/o:0,kt=f-r*n+e-t*n,h=t>0,b=p%1==0?p+".0":""+p,k=w%1==0?w+".0":""+w,et,d,ot,g,st,ht,a,nt,v,y,vt,yt,wt,bt,tt;for(document.getElementById("otBig").textContent=i(s),document.getElementById("otRegPay").textContent=i(l),document.getElementById("otOtPay").textContent=i(f),et=document.querySelectorAll(".ot-mul-label"),d=0;d<et.length;d++)et[d].textContent="("+b+"Ã)";for(document.getElementById("otEnhancedPay").textContent=i(e),ot=document.querySelectorAll(".ot-enh-label"),g=0;g<ot.length;g++)ot[g].textContent="("+k+"Ã)";document.getElementById("otTotalHrs").textContent=o%1==0?o:o.toFixed(2);document.getElementById("otEffRate").textContent=i(ft);document.getElementById("otPremium").textContent=i(kt);st=document.getElementById("otEnhancedPayRow");h?st.classList.remove("hrs-off"):st.classList.add("hrs-off");document.getElementById("otAnnualHead").textContent="Annual projection ("+u+" weeks)";document.getElementById("otAnnualReg").textContent=i(l*u);document.getElementById("otAnnualOt").textContent=i(f*u);document.getElementById("otAnnualEnh").textContent=i(e*u);ht=document.getElementById("otAnnualEnhRow");h?ht.classList.remove("hrs-off"):ht.classList.add("hrs-off");document.getElementById("otAnnualTotal").textContent=i(s*u);a=(r+t)*u;document.getElementById("otAnnualHrs").textContent=a%1==0?a:a.toFixed(1);nt=document.getElementById("otWarn");v="";o>
148?v="Total hours exceed 48 a week. The Working Time Regulations cap average weekly hours at 48 over a 17 week reference period unless you have opted out in writing.":n>0&&n<6&&(v="The hourly rate looks very low. Check it is at or above the National Minimum Wage for the relevant age group.");v?(nt.textContent=v,nt.classList.remove("hrs-off")):nt.classList.add("hrs-off");y="<b>"+c+"<\/b> contracted hours at <b>"+i(n)+"/hr<\/b> plus <b>"+r+"<\/b> overtime hours at <b>"+b+"Ã<\/b>";h&&(y+=" and <b>"+t+"<\/b> enhanced hours at <b>"+k+"Ã<\/b>");y+=" is <b>"+i(s)+"<\/b> gross, giving an effective rate of <b>"+i(ft)+"/hr<\/b>.";document.getElementById("otHeroAnswer").innerHTML=y;document.getElementById("otLiveAnswer").innerHTML=y;document.getElementById("otW1").textContent="Hourly rate: "+i(n);document.getElementById("otW2").textContent="Contracted hours: "+c;document.getElementById("otW3").textContent="Regular pay: "+c+" à "+i(n)+" = "+i(l);document.getElementById("otW4").textContent="Overtime multiplier: "+b+"Ã";document.getElementById("otW5").textContent="Overtime hourly rate: "+i(n)+" à "+b+" = "+i(rt);document.getElementById("otW6").textContent="Overtime pay: "+r+" à "+i(rt)+" = "+i(f);var ct=document.getElementById("otW7"),lt=document.getElementById("otW8"),at=document.getElementById("otW9");h?(ct.textContent="Enhanced multiplier: "+k+"Ã",lt.textContent="Enhanced hourly rate: "+i(n)+" à "+k+" = "+i(ut),at.textContent="Enhanced pay: "+t+" à "+i(ut)+" = "+i(e),ct.classList.remove("hrs-off"),lt.classList.remove("hrs-off"),at.classList.remove("hrs-off")):(ct.classList.add("hrs-off"),lt.classList.add("hrs-off"),at.classList.add("hrs-off"));vt=i(l)+" + "+i(f);h&&(vt+=" + "+i(e));document.getElementById("otW10").textContent="Total gross pay: "+vt+" = "+i(s);yt=c+" + "+r;h&&(yt+=" + "+t);document.getElementById("otW11").textContent="Total hours worked: "+yt+" = "+o;document.getElementById("otW12").textContent="Effective hourly rate: "+i(s)+" ÷ "+o+" = "+i(ft);var dt=r*n,gt=t*n,pt="Overtime premium: the "+i(f)+" overtime pay less what those "+r+" hours would have earned at the flat rate ("+i(dt)+")";h&&(pt+=", plus the "+i(e)+" enhanced pay less its flat rate cost ("+i(gt)+")");pt+=" = "+i(kt)+". This is the extra amount earned purely because of the multiplier.";document.getElementById("otW13").textContent=pt;document.getElementById("otW14").textContent="Annual projection: "+u+" working weeks at "+i(l)+" regular + "+i(f+e)+" overtime = "+i(s*u)+" gross a year, with "+a+" overtime hours.";wt=document.getElementById("otCustomField");$("#otMultiplier").val()==="custom"?wt.classList.remove("hrs-off"):wt.classList.add("hrs-off");bt=document.getElementById("otEnhancedMulField");tt=document.getElementById("otEnhancedCustomField");t>0?(bt.classList.remove("hrs-off"),$("#otEnhancedMul").val()==="custom"?tt.classList.remove("hrs-off"):tt.classList.add("hrs-off")):(bt.classList.add("hrs-off"),tt.classList.add("hrs-off"))}for(ru=document.querySelectorAll('#otCalc input[type="number"]'),tr=0;tr<ru.length;tr++)ru[tr].addEventListener("input",hi);$("#otMultiplier").on("change",hi);$("#otEnhancedMul").on("change",hi);document.getElementById("otPresets").addEventListener("click",function(n){for(var t=n.target,u,c,i,e,o,f;t&&t!==this&&!t.getAttribute("data-ot-rate");)t=t.parentNode;if(t&&t!==this){document.getElementById("otRate").value=t.getAttribute("data-ot-rate");document.getElementById("otHours").value=t.getAttribute("data-ot-hrs");document.getElementById("otOvertimeHrs").value=t.getAttribute("data-ot-ot");var r=t.getAttribute("data-ot-mul"),s=document.getElementById("otMultiplier"),h=!1;for(u=0;u<s.options.length;u++)if(s.options[u].value===r){h=!0;break}if(h&&r!=="custom"?$("#otMultiplier").val(r):($("#otMultiplier").val("custom"),document.getElementById("otCustomMul").value=r),c=t.getAttribute("data-ot-ehrs"),i=t.getAttribute("data-ot-emul"),document.getElementById("otEnhancedHrs").value=c||"0",i){for(e=document.getElementById("otEnhancedMul"),o=!1,f=0;f<e.options.length;f++)if(e.options[f].value===i){o=!0;break}o&&i!=="custom"?$("#otEnhancedMul").val(i):($("#otEnhancedMul").val("custom"),document.getElementById("otEnhancedCustomMul").value=i)}hi()}});hi()}if(document.getElementById("bpBuilder")){function uu(){var n=parseInt(document.getElementById("bpUsers").value,10);return(isNaN(n)||n<1)&&(n=1),n>500&&(n=500),n}function ct(){var t=uu(),f=document.getElementById("bpUsers"),i,r;parseInt(f.value,10)>500&&(f.value=t);var u=0,e=0,o=0,n=[];Array.prototype.forEach.call(document.querySelectorAll("#bpBuilder .bp-check"),function(i){if(i.checked){o++;var r=parseFloat(i.getAttribute("data-bp-price")),s=i.getAttribute("data-bp-type"),f=i.getAttribute("data-bp-name");s==="peruser"?(u+=r*t,n.push(f)):s==="monthly"?(u+=r,n.push(f)):(e+=r,n.push(f))}});document.getElementById("bpCount").textContent=o;document.getElementById("bpSelectedModules").value=n.join("; ");document.getElementById("bpUserCount").value=t;document.getElementById("bpMonthlyTotal").value=u.toFixed(2);document.getElementById("bpOneTimeTotal").value=e.toFixed(2);i=document.getElementById("bpReview");i.innerHTML="";
1n.length?n.forEach(function(n){var t=document.createElement("li");t.textContent=n;i.appendChild(t)}):(r=document.createElement("li"),r.className="bp-review-empty",r.textContent="No modules selected yet. Tick the modules above to build your plan.",i.appendChild(r));document.getElementById("bpReviewUsers").textContent=t}Array.prototype.forEach.call(document.querySelectorAll("#bpBuilder .bp-check"),function(n){n.addEventListener("change",ct)});document.getElementById("bpUsers").addEventListener("input",ct);document.getElementById("bpUsersMinus").addEventListener("click",function(){document.getElementById("bpUsers").value=Math.max(1,uu()-1);ct()});document.getElementById("bpUsersPlus").addEventListener("click",function(){document.getElementById("bpUsers").value=Math.min(500,uu()+1);ct()});p=null;kt=null;function fu(){if(p===null&&window.grecaptcha){var n=function(){if(p===null&&document.getElementById("bpRecaptcha"))try{p=grecaptcha.render("bpRecaptcha",{sitekey:"6Lc1Vv0rAAAAAMxSUMWpBCcxKYLlpgDYXPFAX-mT"})}catch(n){}};typeof grecaptcha.ready=="function"?grecaptcha.ready(n):n()}}function wf(){kt!==null&&(clearInterval(kt),kt=null)}ci=null;function de(){var t,n;ci=document.activeElement;document.getElementById("bpModal").classList.add("bp-open");document.body.classList.add("bp-modal-lock");fu();p===null&&kt===null&&(t=0,kt=setInterval(function(){t++;fu();(p!==null||t>=40)&&wf()},300));n=document.querySelector("#bpModal .bp-modal");n&&n.focus&&n.focus()}function eu(){document.getElementById("bpModal").classList.remove("bp-open");document.body.classList.remove("bp-modal-lock");wf();ci&&ci.focus&&ci.focus()}document.getElementById("bpInquiryBtn").addEventListener("click",function(){if(ct(),!document.querySelector("#bpBuilder .bp-check:checked")){document.getElementById("bpSummaryMsg").classList.remove("hrs-off");return}document.getElementById("bpSummaryMsg").classList.add("hrs-off");$("#bpFormMessage").html("");de()});document.getElementById("bpModalClose").addEventListener("click",eu);ir=!1;document.getElementById("bpModal").addEventListener("mousedown",function(n){ir=n.target===this});document.getElementById("bpModal").addEventListener("click",function(n){n.target===this&&ir&&eu();ir=!1});document.addEventListener("keydown",function(n){(n.keyCode===27||n.key==="Escape"||n.key==="Esc")&&document.getElementById("bpModal").classList.contains("bp-open")&&eu()});$("#bpInquiryForm").off("submit").on("submit",function(n){var t,i,r;if(n.preventDefault(),ct(),!document.querySelector("#bpBuilder .bp-check:checked")){$("#bpFormMessage").html('<div class="alert alert-danger">Please select at least one module for your plan.<\/div>');return}if(t=this,!t.checkValidity()){t.reportValidity();return}if(i=$("#bpSubmit"),fu(),r="",window.grecaptcha&&p!==null)try{r=grecaptcha.getResponse(p)}catch(u){}if(!r){window.grecaptcha?$("#bpFormMessage").html('<div class="alert alert-danger">Please verify captcha.<\/div>'):$("#bpFormMessage").html('<div class="alert alert-danger">The verification service could not be loaded. Please allow google.com/recaptcha in your browser or content blocker and try again, or email us directly.<\/div>');return}i.prop("disabled",!0).text("Sending...");$.ajax({url:"/plan-inquiry",type:"POST",data:new FormData(t),processData:!1,contentType:!1,success:function(n){if(n.success)window.location.href="/thank-you";else if($("#bpFormMessage").html('<div class="alert alert-danger">'+n.message+"<\/div>"),i.prop("disabled",!1).text("Send Inquiry"),window.grecaptcha&&p!==null)try{grecaptcha.reset(p)}catch(t){}},error:function(){if($("#bpFormMessage").html('<div class="alert alert-danger">Something went wrong.<\/div>'),i.prop("disabled",!1).text("Send Inquiry"),window.grecaptcha&&p!==null)try{grecaptcha.reset(p)}catch(n){}}})});ct()}if(document.getElementById("mgCalc")){lt="prices";function ut(n){var t=parseFloat(document.getElementById(n).value);return isNaN(t)||t<0?0:t}function e(n){var t=n<0,i=Math.abs(n).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",");return(t?"-£":"£")+i}function ft(n){return n.toFixed(2)+"%"}function bf(n){var i,t;for(lt=n,i=document.querySelectorAll("#mgTabs .roi-tab"),t=0;t<i.length;t++)i[t].getAttribute("data-mg-mode")===n?i[t].classList.add("active"):i[t].classList.remove("active");document.getElementById("mgPriceField").classList.toggle("hrs-off",n!=="prices");document.getElementById("mgMarkupField").classList.toggle("hrs-off",n!=="markup");document.getElementById("mgMarginField").classList.toggle("hrs-off",n!=="margin")}function kf(n,t){var i=document.getElementById(n);i&&(i.value=Math.min(parseFloat(i.max),t))}function dt(){var n=ut("mgCost"),t=0,f,s,c;kf("mgMarkupRange",ut("mgMarkup"));kf("mgTargetMarginRange",ut("mgTargetMargin"));lt==="prices"?t=ut("mgPrice"):lt==="markup"?t=n*(1+ut("mgMarkup")/100):(f=ut("mgTargetMargin"),f>95&&(f=95,document.getElementById("mgTargetMargin").value=95),t=n/(1-f/100));var i=t-n,r=n>0?i/n*100:0,u=t>0?i/t*100:0,h=n>0?t/n:0,o="";n<=0?o="Enter a cost above zero to get meaningful percentages.":i<0&&(o="The selling price is below cost: this job loses "+e(Math.abs(i))+". The margin and markup are negative.");s=document.getElementById("mgWarn");o?(s.textContent=o,s.classList.remove("hrs-off")):s.classList.add("hrs-off");lt==="prices"?(document.getElementById("mgBig").textContent=ft(u),document.getElementById("mgBigCap").textContent="Profit margin on the price"):(document.getElementById("mgBig").textContent=e(t),document.getElementById("mgBigCap").textContent="Selling price to charge");document.getElementById("mgOutCost").textContent=e(n);document.getElementById("mgOutPrice").textContent=e(t);document.getElementById("mgOutProfit").textContent=e(i);document.getElementById("mgOutMarkup").textContent=ft(r);document.getElementById("mgOutMargin").textContent=ft(u);document.getElementById("mgOutMult").textContent=h.toFixed(2)+"Ã";c="Cost <b>"+e(n)+"<\/b>, sold at <b>"+e(t)+"<\/b>, keeps <b>"+e(i)+"<\/b> profit: a <b>"+ft(u)+"<\/b> margin on the price, which is a <b>"+ft(r)+"<\/b> markup on the cost.";document.getElementById("mgLiveAnswer").innerHTML=c;document.getElementById("mgHeroAnswer").innerHTML=c;document.getElementById("mgW1").textContent="Cost: "+e(n);document.getElementById("mgW2").textContent=lt==="markup"?"Selling price: "+e(n)+" à (1 + "+ut("mgMarkup")+" ÷ 100) = "+e(t):lt==="margin"?"Selling price: "+e(n)+" ÷ (1 - "+ut("mgTargetMargin")+" ÷ 100) = "+e(t):"Selling price: "+e(t);document.getElementById("mgW3").textContent="Profit: "+e(t)+" - "+e(n)+" = "+e(i);document.getElementById("mgW4").textContent="Markup on cost: "+e(i)+" ÷ "+e(n)+" à 100 = "+ft(r);document.getElementById("mgW5").textContent="Margin on price: "+e(i)+" ÷ "+e(t)+" à 100 = "+ft(u);document.getElementById("mgW6").textContent="Revenue multiplier: "+e(t)+" ÷ "+e(n)+" = "+h.toFixed(2)+"Ã, so every £1 of cost returns £"+h.toFixed(2)+" of price";document.getElementById("mgW7").textContent="Cross-check: markup ÷ (100 + markup) à 100 = "+r.toFixed(2)+" ÷ "+(100+r).toFixed(2)+" à 100 = "+ft(u)+", which is the margin"}for(ou=document.querySelectorAll("#mgTabs .roi-tab"),rr=0;rr<ou.length;rr++)ou[rr].addEventListener("click",function(){bf(this.getAttribute("data-mg-mode"));dt()});for(su=["mgCost","mgPrice","mgMarkup","mgTargetMargin"],ur=0;ur<su.length;ur++)document.getElementById(su[ur]).addEventListener("input",dt);hu=document.getElementById("mgMarkupRange");hu&&hu.addEventListener("input",function(){document.getElementById("mgMarkup").value=this.value;dt()});cu=document.getElementById("mgTargetMarginRange");cu&&cu.addEventListener("input",function(){document.getElementById("mgTargetMargin").value=this.value;dt()});document.getElementById("mgPresets").addEventListener("click",function(n){for(var t=n.target;t&&t!==this&&!t.getAttribute("data-mg-cost");)t=t.parentNode;t&&t!==this&&(bf(t.getAttribute("data-mg-mode")),document.getElementById("mgCost").value=t.getAttribute("data-mg-cost"),t.getAttribute("data-mg-price")&&(document.getElementById("mgPrice").value=t.getAttribute("data-mg-price")),t.getAttribute("data-mg-markup")&&(document.getElementById("mgMarkup").value=t.getAttribute("data-mg-markup")),t.getAttribute("data-mg-margin")&&(document.getElementById("mgTargetMargin").value=t.getAttribute("data-mg-margin")),dt())});dt()}if(document.getElementById("incCalc")){function gt(n,t,i){var r=parseFloat(document.getElementById(n).value);return isNaN(r)&&(r=0),r<t&&(r=t),r>i&&(r=i),r}function s(n){return"£"+n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")}function at(n){return Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function fr(){var n=gt("incIncome",0,1e7),o=gt("incWeeks",1,52),h=gt("incHours",1,80),t=gt("incBillable",10,95),v=gt("incExpenses",0,1e6),c=gt("incBuffer",0,50),a,p;document.getElementById("incBillableRange").value=t;var i=o*h,r=i*t/100,w=h*t/100,l=n+v,u=r>0?l/r:0,f=u*(1+c/100),b=f*7.5,y=i>0?n/i:0,k=f-y,e="";n<=0?e="Enter an income target above zero to get a meaningful rate.":t>80?e="Most independent professionals bill 50 to 70% of their time. Above 80% leaves very little room for admin, proposals and finding the next client.":o>50&&(e="More than 50 working weeks leaves under two weeks a year for holiday and sickness combined.");a=document.getElementById("incWarn");e?(a.textContent=e,a.classList.remove("hrs-off")):a.classList.add("hrs-off");document.getElementById("incBig").textContent=s(u);document.getElementById("incRec").textContent=s(f);document.getElementById("incBufLabel").textContent="(+"+c+"% buffer)";document.getElementById("incBillWeek").textContent=w.toFixed(1);document.getElementById("incBillYear").textContent=at(r);document.getElementById("incDay").textContent=s(b);document.getElementById("incNaive").textContent=s(y);p="Earning <b>"+s(n)+"<\/b> before tax from <b>"+o+"<\/b> weeks of <b>"+h+"<\/b> hour weeks at <b>"+t+"%<\/b> billable with <b>"+s(v)+"<\/b> of expenses needs <b>"+s(u)+"<\/b> an hour to break even, and <b>"+s(f)+"<\/b> with a <b>"+c+"%<\/b> buffer.";document.getElementById("incLiveAnswer").innerHTML=p;document.getElementById("incHeroAnswer").innerHTML=p;document.getElementById("incW1").textContent="Total working hours: "+o+" weeks à "+h+" hours = "+at(i);document.getElementById("incW2").textContent="Billable hours: "+at(i)+" à "+t+"% = "+at(r)+" a year ("+w.toFixed(1)+" a week)";document.getElementById("incW3").textContent="Revenue needed: "+s(n)+" income + "+s(v)+" expenses = "+s(l);document.getElementById("incW4").textContent="Break-even rate: "+s(l)+" ÷ "+at(r)+" = "+s(u)+" an hour";document.getElementById("incW5").textContent="Recommended rate: "+s(u)+" à (1 + "+c+" ÷ 100) = "+s(f)+" an hour";document.getElementById("incW6").textContent="Day rate: "+s(f)+" à 7.5 billed hours = "+s(b);document.getElementById("incW7").textContent="Naive rate: "+s(n)+" ÷ "+at(i)+" working hours = "+s(y)+", which is "+s(k)+" an hour below the recommended rate because it prices non-billable time and expenses at zero";document.getElementById("incW8").textContent="Check: "+at(r)+" billable hours à "+s(u)+" break-even covers the "+s(l)+" needed"}for(lu=["incIncome","incWeeks","incHours","incBillable","incExpenses","incBuffer"],er=0;er<lu.length;er++)document.getElementById(lu[er]).addEventListener("input",fr);document.getElementById("incBillableRange").addEventListener("input",function(){document.getElementById("incBillable").value=this.value;fr()});document.getElementById("incPresets").addEventListener("click",function(n){for(var t=n.target;t&&t!==this&&!t.getAttribute("data-inc-income");)t=t.parentNode;t&&t!==this&&(document.getElementById("incIncome").value=t.getAttribute("data-inc-income"),document.getElementById("incWeeks").value=t.getAttribute("data-inc-weeks"),document.getElementById("incHours").value=t.getAttribute("data-inc-hours"),document.getElementById("incBillable").value=t.getAttribute("data-inc-bill"),document.getElementById("incExpenses").value=t.getAttribute("data-inc-exp"),fr())});fr()}if(document.getElementById("payCalc")){var li=["hour","day","week","fortnight","fourweek","month","quarter","year"],df={hour:"Hour",day:"Day",week:"Week",fortnight:"Fortnight",fourweek:"FourWeek",month:"Month",quarter:"Quarter",year:"Year"},gf={hour:"an hour",day:"a day",week:"a week",fortnight:"a fortnight",fourweek:"every four weeks",month:"a calendar month",quarter:"a quarter",year:"a year"},or={hour:2e3,day:2e4,week:1e5,fortnight:2e5,fourweek:2e5,month:2e5,quarter:6e5,year:2e6},ge={paid:{hour:"Hourly pay, holiday paid",day:"Day rate, holiday paid",week:"Weekly pay, holiday paid",fortnight:"Fortnightly pay, holiday paid",fourweek:"Four weekly pay, holiday paid",month:"Monthly salary, holiday paid",quarter:"Quarterly amount, holiday paid",year:"Salary, holiday paid"},unpaid:{hour:"Hourly rate, only paid for time worked",day:"Day rate, only paid for time worked",week:"Weekly rate, only paid for time worked",fortnight:"Fortnightly rate, only paid for time worked",fourweek:"Four weekly rate, only paid for time worked",month:"Monthly figure, only paid for time worked",quarter:"Quarterly figure, only paid for time worked",year:"Annual figure, only paid for time worked"}},ne="paid";function sr(n){var i=document.getElementById(n),t=parseFloat(i.value),r=parseFloat(i.min),u=parseFloat(i.max);return isNaN(t)?r:t<r?r:t>u?u:t}function ni(n){var i=document.getElementById(n),t;return i?(t=parseFloat(i.value),isNaN(t)||t<0?0:t):0}function r(n){return!isFinite(n)||isNaN(n)?"£0.00":"£"+n.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g,",")}function t(n){(!isFinite(n)||isNaN(n)||n<0)&&(n=0);var t=(Math.round(n*100)/100).toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function l(n){return t(n)}function hr(n,t){return(!isFinite(n)||isNaN(n)||n<0)&&(n=0),n.toFixed(t)+"%"}function n(n,t){var i=document.getElementById(n);i&&(i.textContent=t)}function te(n,t){var i=document.getElementById(n);i&&(i.innerHTML=t)}function w(n,t){var i=document.getElementById(n);i&&i.classList.toggle("hrs-off",!!t)}function no(n,t){var i=document.getElementById(n);i&&i.setAttribute("aria-label",t)}function to(n,t){var i=document.getElementById(n);i&&(i.setAttribute("data-tip",t),i.setAttribute("aria-label",t))}function au(){return document.getElementById("payPeriod").value}function cr(){return document.getElementById("payBasis").value==="unpaid"?"unpaid":"paid"}function vu(n,t,i,r,u){var f=t==="paid"?52:u;return n==="hour"?i*f:n==="day"?r*f:n==="week"?f:n==="fortnight"?t==="paid"?26:u/2:n==="fourweek"?t==="paid"?13:u/4:n==="month"?12:n==="quarter"?4:1}function a(n,t){var i=document.getElementById(n),r,u;i&&(i.value=t,r=sr(n),i.value=r,u=document.getElementById(n+"Range"),u&&(u.value=r))}function lr(){var n=au(),i=document.getElementById("payAmount"),t;i&&(i.max=or[n]||2e6);t=n==="hour"||n==="day";w("payProGroup",t);w("payProNote",!t)}function ar(){var f=cr();if(f!==ne){ne=f;var i=f==="paid",e=document.getElementById("payWeeks"),o=document.getElementById("payWeeksRange"),t=Math.round((52-ni("payWeeks"))*10)/10,r=i?0:1,u=i?20:52;t<r&&(t=r);t>u&&(t=u);e.min=r;e.max=u;o.min=r;o.max=u;e.value=t;o.value=t;n("payWeeksLabelText",i?"Weeks off a year (holiday and bank holidays)":"Weeks you work and get paid for");to("payWeeksTip",i?"Paid time off in weeks: annual leave plus any bank holidays you get. UK statutory minimum paid annual leave is 5.6 weeks under the Working Time Regulations 1998, and there is no automatic right to paid time off on bank holidays on top of it. This changes the at-work hourly and daily figures only, never the weekly, monthly, quarterly or annual rows.":"The weeks in a year you actually work and get paid for, after holiday, gaps between contracts and sickness. It is the single biggest variable in an annual figure from a day rate, and there is no honest default for it: the figure it starts on is a placeholder carried over from statutory minimum leave, not an estimate. Replace it with your own.")}}function v(){var o=au(),rt=cr(),u=rt==="paid",st=ni("payAmount"),ut=or[o]||2e6,nt=st>ut?ut:st,e=ni("payHours"),h,d,gt,at,pi,v,ti,ii,ri,c,ft,ui,et,ot,vt,yt,fi,ei,g;e>80&&(e=80);h=ni("payDays");h>7&&(h=7);var y=ni("payWeeks"),ht=u?y>51?51:y:0,i=u?52-ht:y>52?52:y;u&&i<1&&(i=1);var oi=document.getElementById("payProOn").value==="yes",si=o!=="hour"&&o!=="day",tt=ni("pay
1FullHours");tt>80&&(tt=80);var pt=oi&&si&&tt>0,ct=pt?e/tt:1,hi=nt*vu(o,rt,e,h,i),s=hi*ct,ci=s>1e8;ci&&(s=1e8);var p=52*e,a=i*e,wt=52*h,lt=i*h,b=h>0?e/h:0,wi=p>0?s/p:0,bt=a>0?s/a:0,bi=wt>0?s/wt:0,ai=lt>0?s/lt:0,it=u?wi:bt,vi=u?bi:ai,kt=u?s/52:i>0?s/i:0,ki=u?s/26:i>0?s/(i/2):0,di=u?s/13:i>0?s/(i/4):0,dt=s/12,gi=s/4,yi=u&&a>0?(p/a-1)*100:0,k=u&&ht>0,f=r(s);for(n("payModeLine",ge[rt][o]),n("payHourMain",r(it)),n("payHourMainCap",u?"you are paid":"per hour worked"),n("payHourAtWork",r(bt)),w("payHourAtWorkCell",!k),n("payDayMain",r(vi)),n("payDayMainCap",u?"you are paid":"per day worked"),n("payDayAtWork",r(ai)),w("payDayAtWorkCell",!k),n("payWeek",r(kt)),n("payMonth",r(dt)),n("payYear",f),n("payFortnight",r(ki)),n("payFourWeek",r(di)),n("payQuarter",r(gi)),n("payWeekName",u?"A week":"A week you work"),n("payFortnightName",u?"A fortnight":"A fortnight you work"),n("payFourWeekName",u?"Four weekly":"Four weeks you work"),u?(n("payHourMainSub",t(p)+" paid hours a year: "+f+" ÷ (52 weeks à "+t(e)+")"),n("payDayMainSub",t(wt)+" paid days a year: "+f+" ÷ (52 weeks à "+t(h)+")"),n("payWeekSub","52 weeks a year: "+f+" ÷ 52"),n("payFortnightSub","26 payments a year: "+f+" ÷ 26"),n("payFourWeekSub","13 payments a year, not 12: "+f+" ÷ 13"),n("payMonthSub","12 payments a year: "+f+" ÷ 12, never ÷ 4 weeks")):(n("payHourMainSub",t(a)+" hours worked a year: "+f+" ÷ ("+l(i)+" weeks à "+t(e)+")"),n("payDayMainSub",t(lt)+" days worked a year: "+f+" ÷ ("+l(i)+" weeks à "+t(h)+")"),n("payWeekSub",l(i)+" paid weeks a year: "+f+" ÷ "+l(i)),n("payFortnightSub",t(i/2)+" fortnights worked a year: "+f+" ÷ "+t(i/2)),n("payFourWeekSub",t(i/4)+" four week blocks a year: "+f+" ÷ "+t(i/4)),n("payMonthSub","12 months a year: "+f+" ÷ 12, a smoothed average rather than a payment date")),n("payHourAtWorkSub",t(a)+" hours at work a year: "+f+" ÷ ("+l(i)+" weeks à "+t(e)+")"),n("payDayAtWorkSub",t(lt)+" days at work a year: "+f+" ÷ ("+l(i)+" weeks à "+t(h)+")"),w("payHourAtWorkSub",!k),w("payDayAtWorkSub",!k),n("payQuarterSub","A budgeting figure, not a UK pay frequency: "+f+" ÷ 4"),d=0;d<li.length;d++)gt=document.getElementById("payRung"+df[li[d]]),gt&>.classList.toggle("pay-rung-source",li[d]===o),w("payTag"+df[li[d]],li[d]!==o);u?n("payCompareLine","Four weekly pay is 13 payments a year and calendar monthly is 12, so the same "+f+" shows as "+r(s/13)+" on one payslip and "+r(s/12)+" on the other. Same salary, different frequency."):n("payCompareLine","Averaged across the calendar, "+f+" a year is "+r(s/13)+" every four weeks and "+r(s/12)+" a calendar month: 13 four week blocks against 12 months, which is why the two are never the same number.");u?k?n("payPairNote","The at-work figure is higher because your holiday is paid, so the same money is spread over fewer hours actually worked. The first figure is what you are paid per hour. The second is what an hour of your attendance works out at, and it is the start of a staff cost rate, before employer National Insurance, pension and overheads, which this page does not calculate."):n("payPairNote","With no weeks off, the hours you are paid for and the hours you are at work are the same hours, so there is one hourly figure and one daily figure."):n("payPairNote","There is one hourly figure and one daily figure here because unworked time is unpaid, so the hours you are paid for and the hours you are at work are the same hours.");at=o==="hour"||o==="day";n("payBig",at?f:r(it));pi=at?"Gross a year, worked out from the "+(o==="hour"?"hourly":"daily")+" figure you entered":u?"Gross per hour you are paid, from "+f+" a year over "+t(p)+" paid hours":"Gross per hour worked, from "+f+" a year over "+t(a)+" hours worked";n("payBigCap",pi);w("payAnnualRow",at);n("payAnnual",f);w("payPaidHoursRow",!u);n("payPaidHoursLabel","Hours you are paid for, a year (52 à "+t(e)+")");n("payPaidHours",t(p));n("payWorkHoursLabel",u?"Hours you are actually at work, a year ("+l(i)+" à "+t(e)+")":"Hours you work and are paid for, a year ("+l(i)+" à "+t(e)+")");n("payWorkHours",t(a));n("payDayHoursLabel","Hours in a working day ("+t(e)+" ÷ "+t(h)+")");n("payDayHours",t(b));w("payGapRow",!k);n("payGap",hr(yi,2));w("payProRow",!pt);n("payProLabel",r(hi)+" full time, scaled to "+t(e)+" of "+t(tt)+" hours");n("payProOut",f);v=i/52*100;(!isFinite(v)||v<0)&&(v=0);v>100&&(v=100);ti=document.getElementById("payBarFill");ti&&(ti.style.width=v.toFixed(2)+"%");n("payBarPct",hr(v,1));ii=u?"At work "+l(i)+" of 52 paid weeks":"Paid for "+l(i)+" of 52 weeks";n("payBarLabel",ii);
1no("payBarWrap",ii+", which is "+hr(v,1)+" of the year.");ri=document.getElementById("payDayLen");ri&&(ri.value=b>0?t(b):"");c="";st<=0?c="Enter what you earn and the period you earn it in, and every period on the ladder fills in at once.":e<=0||h<=0?c="Hours a week and days a week both have to be more than zero before there can be an hourly or a daily figure. The weekly, monthly, quarterly and annual rows do not depend on either of them.":st>ut?c="This converter takes up to "+r(ut)+" "+gf[o]+", so the figures below are using "+r(ut)+".":ci?c="This converter stops at £100,000,000 a year, so the figures below are capped.":b>24?c="That is "+t(b)+" hours in a working day, which no day contains. Check your hours a week and your days a week.":u&&y>51?c="Weeks off cannot be more than 51 in a 52 week year, so 51 is being used.":!u&&y>=52?c="52 paid weeks allows for no holiday, no gaps between contracts and no sickness at all. Weeks you work and get paid for drives the annual figure more than anything else on this page, and only you know it.":!u&&y>0&&y<20?c="Weeks you work and get paid for drives the annual figure more than anything else on this page, so check that figure really is yours.":u&&ht===0?c="With no weeks off, the paid figure and the at-work figure are the same. UK statutory minimum paid annual leave is 5.6 weeks under the Working Time Regulations 1998, and there is no automatic right to paid time off on bank holidays on top of it.":oi&&si&&tt<=0?c="Enter the full time hours a week the salary is advertised against and the pro rata scaling will apply.":pt&&ct>1?c="Your hours are more than the full time hours you entered, so the pro rata figure is above the advertised salary. Pro rata normally scales down.":b>16&&(c="That is "+t(b)+" hours in a working day. Check your hours a week and your days a week.");ft=document.getElementById("payWarn");ft&&(c?(ft.textContent=c,ft.classList.remove("hrs-off")):ft.classList.add("hrs-off"));ui=!u&&nt>0&&i>0&&(o==="hour"||o==="day"||o==="week"||o==="fortnight"||o==="fourweek");ui&&(et=i-4,et<1&&(et=1),ot=i+4,ot>52&&(ot=52),vt=nt*vu(o,rt,e,h,et)*ct,yt=nt*vu(o,rt,e,h,ot)*ct,vt>1e8&&(vt=1e8),yt>1e8&&(yt=1e8),n("paySenseLine","At "+l(et)+" paid weeks this is "+r(vt)+" a year, at "+l(i)+" it is "+f+", and at "+l(ot)+" it is "+r(yt)+". No average is offered here, because only you know your weeks."));w("paySenseLine",!ui);n("payWDiv","The divisors in use right now: 52 à "+t(e)+" = "+t(p)+" paid hours, and "+l(i)+" à "+t(e)+" = "+t(a)+" hours at work, so you can check any figure by hand.");fi=Math.round(it*100)/100;ei=u?p:a;n("payWRound","Figures are rounded for display only: "+r(fi)+" an hour à "+t(ei)+" hours comes to "+r(fi*ei)+", not exactly "+f+". That is display rounding, not an error. The unrounded figure is £"+it.toFixed(6)+" an hour.");nt<=0?g="Enter what you earn and the period you earn it in, and every other period fills in at once: per hour, per day, per week, per fortnight, per four weeks, per calendar month, per quarter and per year. Every figure here is gross pay, before Income Tax, National Insurance, pension contributions and any student loan deduction.":u?(g="<b>"+f+"<\/b> a year, on <b>"+t(e)+"<\/b> hours over <b>"+t(h)+"<\/b> days with <b>"+l(ht)+"<\/b> weeks off, is <b>"+r(it)+"<\/b> an hour, <b>"+r(vi)+"<\/b> a day, <b>"+r(kt)+"<\/b> a week and <b>"+r(dt)+"<\/b> a calendar month.",k&&(g+=" Because your holiday is paid, the same salary is <b>"+r(bt)+"<\/b> for each hour you are actually at work, which is <b>"+hr(yi,2)+"<\/b> higher."),g+=" Every figure here is gross pay, before Income Tax, National Insurance, pension contributions and any student loan deduction."):g="<b>"+r(nt)+"<\/b> "+gf[o]+", on <b>"+t(h)+"<\/b> days a week over <b>"+l(i)+"<\/b> weeks you work and get paid for, is <b>"+f+"<\/b> a year, <b>"+r(it)+"<\/b> an hour, <b>"+r(kt)+"<\/b> a week you work and <b>"+r(dt)+"<\/b> a calendar month, averaged across the year. Because unworked time is unpaid, there is one hourly figure here rather than two. Every figure here is gross pay, before Income Tax, National Insurance, pension contributions and any student loan deduction.";te("payLiveAnswer",g);te("payHeroAnswer",g)}document.getElementById("payAmount").addEventListener("input",v);document.getElementById("payAmount").addEventListener("change",function(){this.value=sr("payAmount");v()});["payHours","payDays","payWeeks","payFullHours"].forEach(function(n){var t=document.getElementById(n),i=document.getElementById(n+"Range");t&&i&&(i.addEventListener("input",function(){t.value=i.value;v()}),t.addEventListener("input",v),t.addEventListener("change",function(){var r=sr(n);t.value=r;i.value=r;v()}))});document.getElementById("payDayLen").addEventListener("change",function(){var t=parseFloat(this.value),i=sr("payDays"),n;if(isNaN(t)||t<=0||i<=0){v();return}t>24&&(t=24);n=Math.round(t*i*100)/100;n<1&&(n=1);n>80&&(n=80);document.getElementById("payHours").value=n;document.getElementById("payHoursRange").value=n;v()});$("#payPeriod").on("change",function(){lr();v()});$("#payBasis").on("change",function(){ar();v()});$("#payProOn").on("change",function(){document.getElementById("payFullHoursField").classList.toggle("roi-field-hidden",this.value!=="yes");v()});document.getElementById("payPresets").addEventListener("click",function(n){for(var t=n.target;t&&t!==this&&(!t.getAttribute||t.getAttribute("data-pay-chip")===null);)t=t.parentNode;if(t&&t!==this&&t.getAttribute){var r=t.getAttribute("data-pay-hours"),u=t.getAttribute("data-pay-days"),i=t.getAttribute("data-pay-weeksoff");r!==null&&a("payHours",r);u!==null&&a("payDays",u);i!==null&&a("payWeeks",cr()==="paid"?i:52-parseFloat(i));v()}});yu=document.getElementById("payAnswers");yu&&yu.addEventListener("click",function(n){for(var t=n.target,i,r,u,f;t&&t!==this&&(!t.getAttribute||t.getAttribute("data-pay-amount")===null);)t=t.parentNode;t&&t!==this&&t.getAttribute&&(i=t.getAttribute("data-pay-per"),r=t.getAttribute("data-pay-basis"),i!==null&&or.hasOwnProperty(i)&&(document.getElementById("payPeriod").value=i),lr(),(r==="paid"||r==="unpaid")&&(document.getElementById("payBasis").value=r),ar(),t.getAttribute("data-pay-weeks")!==null&&a("payWeeks",t.getAttribute("data-pay-weeks")),a("payAmount",t.getAttribute("data-pay-amount")),t.getAttribute("data-pay-hours")!==null&&a("payHours",t.getAttribute("data-pay-hours")),v(),u=document.getElementById("pay-converter-tool"),u&&u.scrollIntoView&&u.scrollIntoView({behavior:"smooth",block:"start"}
1),f=document.getElementById("payBig"),f&&f.focus&&f.focus())});function ie(n,t){var i=document.createElement("textarea");i.value=n;i.setAttribute("readonly","readonly");i.style.position="fixed";i.style.top="-1000px";document.body.appendChild(i);i.select();try{document.execCommand("copy");t()}catch(r){}document.body.removeChild(i)}function re(n,t,i){var r=function(){t.textContent="Copied";t.classList.add("hrs-copied");setTimeout(function(){t.textContent=i;t.classList.remove("hrs-copied")},1600)};try{if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(n).then(r,function(){ie(n,r)});return}}catch(u){}ie(n,r)}function io(){var n="?amount="+encodeURIComponent(document.getElementById("payAmount").value)+"&per="+encodeURIComponent(au())+"&basis="+encodeURIComponent(cr())+"&hours="+encodeURIComponent(document.getElementById("payHours").value)+"&days="+encodeURIComponent(document.getElementById("payDays").value)+"&weeks="+encodeURIComponent(document.getElementById("payWeeks").value)+"&pro="+encodeURIComponent(document.getElementById("payProOn").value)+"&fth="+encodeURIComponent(document.getElementById("payFullHours").value);return window.location.protocol+"//"+window.location.host+window.location.pathname+n}document.getElementById("payCopy").addEventListener("click",function(){re(document.getElementById("payLiveAnswer").textContent+" Worked out at quantim.co.uk/salary-to-hourly-rate-calculator",this,"Copy the answer")});document.getElementById("payShare").addEventListener("click",function(){re(io(),this,"Copy the link")});navigator.clipboard&&navigator.clipboard.writeText||document.execCommand||(document.getElementById("payCopy").classList.add("hrs-off"),document.getElementById("payShare").classList.add("hrs-off"));document.getElementById("payReset").addEventListener("click",function(){document.getElementById("payPeriod").value="year";document.getElementById("payBasis").value="paid";document.getElementById("payProOn").value="no";document.getElementById("payFullHoursField").classList.add("roi-field-hidden");lr();ar();a("payWeeks",5.6);a("payAmount",45e3);a("payHours",37.5);a("payDays",5);a("payFullHours",37.5);v()});function et(n){var t=new RegExp("[?&]"+n+"=([^&#]*)").exec(window.location.search);return t?decodeURIComponent(t[1].replace(/\+/g," ")):null}(function(){if(window.location.search){var t=et("per"),i=et("basis"),r=et("amount"),u=et("hours"),f=et("days"),e=et("weeks"),n=et("pro"),o=et("fth");t!==null&&or.hasOwnProperty(t)&&(document.getElementById("payPeriod").value=t);lr();(i==="paid"||i==="unpaid")&&(document.getElementById("payBasis").value=i);ar();e!==null&&/^\d{1,2}(\.\d)?$/.test(e)&&a("payWeeks",e);r!==null&&/^\d{1,9}(\.\d{1,2})?$/.test(r)&&a("payAmount",r);u!==null&&/^\d{1,2}(\.\d{1,2})?$/.test(u)&&a("payHours",u);f!==null&&/^[1-7](\.\d)?$/.test(f)&&a("payDays",f);(n==="yes"||n==="no")&&(document.getElementById("payProOn").value=n,document.getElementById("payFullHoursField").classList.toggle("roi-field-hidden",n!=="yes"));o!==null&&/^\d{1,2}(\.\d{1,2})?$/.test(o)&&a("payFullHours",o)}})();v()}})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.