Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var grade = {
- "Foundation doctor year 1": {
- 0: 22636,
- 1: 24049,
- 2: 25461
- },
- "Foundation doctor year 2": {
- 0: 28076,
- 1: 29912,
- 2: 31748
- },
- "Specialty registrar core training": {
- 0: 30002,
- 1: 31838,
- 2: 34402,
- 3: 35952,
- 4: 37822,
- 5: 39693
- },
- "Specialty registrar full": {
- 0: 30002,
- 1: 31838,
- 2: 34402,
- 3: 35952,
- 4: 37822,
- 5: 39693,
- 6: 41564,
- 7: 43434,
- 8: 45304,
- 9: 47175
- },
- "GP registrar": {
- 0: 30002,
- 1: 31838,
- 2: 34402,
- 3: 35952,
- 4: 37822,
- 5: 39693,
- 6: 41564,
- 7: 43434,
- 8: 45304,
- 9: 47175
- }
- },
- training = {
- F1: 25500,
- F2: 31600,
- "Registrar 1": 37400,
- "Registrar 2": 42500,
- "Registrar 3": 48400,
- "Registrar 4": 55e3
- },
- banding = {
- "No banding": 0,
- "Foundation doctor year one, five percent supplement": 5,
- "In practice GP supplement": 45,
- "Band 1A": 50,
- "Band 1B": 40,
- "Band 1C": 20,
- "Band 2A": 80,
- "Band 2B": 50,
- "Band 3 (80% is the maximum level to which pay protection will be applied)": 100
- },
- programme_payout = {
- "N/A": 0,
- "Emergency medicine (ST4 and above)": {
- supplement: 1500
- },
- "General Practice (in practice placements)": {
- supplement: 8200
- },
- "Psychiatry (ST1 and above) ": {
- supplement: 1500
- }
- },
- flexible_payment = {
- "Not applicable": 0,
- "Clinical academics": -1,
- "Training in public health": -1,
- "For retraining/switching specialty": -1
- },
- rotas = {
- 1: {
- ave_hrs: 40,
- sat_pre: 0,
- sun_pre: 0,
- night_pre: 0,
- avail_pre: 0
- },
- 2: {
- ave_hrs: 40,
- sat_pre: 0,
- sun_pre: 0,
- night_pre: 0,
- avail_pre: 0
- },
- 3: {
- ave_hrs: 45,
- sat_pre: 0,
- sun_pre: 0,
- night_pre: 0,
- avail_pre: 0
- },
- 4: {
- ave_hrs: 47.5,
- sat_pre: .75,
- sun_pre: 3.25,
- night_pre: 0,
- avail_pre: 0
- },
- 5: {
- ave_hrs: 45.1666666666667,
- sat_pre: .5,
- sun_pre: 2.16666666666667,
- night_pre: 0,
- avail_pre: 0
- },
- 6: {
- ave_hrs: 45.125,
- sat_pre: .375,
- sun_pre: 1.625,
- night_pre: 0,
- avail_pre: 0
- },
- 7: {
- ave_hrs: 45.3333333333333,
- sat_pre: .666666666666667,
- sun_pre: 2.33333333333333,
- night_pre: 10.5,
- avail_pre: 0
- },
- 8: {
- ave_hrs: 45.25,
- sat_pre: .5,
- sun_pre: 1.75,
- night_pre: 7.875,
- avail_pre: 0
- },
- 9: {
- ave_hrs: 45.2,
- sat_pre: .4,
- sun_pre: 1.4,
- night_pre: 6.3,
- avail_pre: 0
- },
- 10: {
- ave_hrs: 47.3333333333333,
- sat_pre: 0,
- sun_pre: 1.5,
- night_pre: 3.5,
- avail_pre: 4
- },
- 11: {
- ave_hrs: 46.75,
- sat_pre: 0,
- sun_pre: 1.125,
- night_pre: 2.625,
- avail_pre: 4
- },
- 12: {
- ave_hrs: 43.1,
- sat_pre: .1,
- sun_pre: .7,
- night_pre: .7,
- avail_pre: 2
- }
- };
- jQuery(document).ready(function(a) {
- function e(a) {
- return grade[a]
- }
- function t() {
- S = 0, N = 0, r(Math.round(l()), a(".existing_basicpay"), a("#graph-existing-basic-pay")), r(Math.round(c()), a(".existing_bandingpayment"), a("#graph-existing-banding-payment")), a(".existing_total").html(B(Math.round(h())))
- }
- function n() {
- T = 0, I = 0, i(Math.round(u()), a(".new_basicpay"), a("#graph-new-basic-pay")), i(Math.round(v()), a(".new_rosteredhours"), a("#graph-new-rostered-hours")), i(Math.round(d()), a(".new_saturdaypremium"), a("#graph-new-saturday-prem")), i(Math.round(g()), a(".new_sundaypremium"), a("#graph-new-sunday-prem")), i(Math.round(_()), a(".new_nightpremium"), a("#graph-new-night-prem")), i(Math.round(m()), a(".new_availability"), a("#graph-new-availablity")), i(Math.round(f()), a(".new_programmepremium"), a("#graph-new-programme-prem"));
- var e = q();
- 0 == e ? i(Math.round(q()), a(".new_flexiblepremium"), a("#graph-new-pay-prem")) : a(".new_flexiblepremium").html("To be determined"), i(Math.round(b()), a(".new_payprotection"), a("#graph-new-pay-protection")), a(".new_total").html(B(Math.round(y())))
- }
- function r(a, e, t) {
- var n = o(),
- r = parseFloat(N) / n * 100,
- i = a / n * 100;
- e.html(B(a)), t.css("height", "" + i + "%"), t.css("bottom", r + "%"), N = parseInt(N) + parseInt(a), i > 0 && (S = parseFloat(S) + parseFloat(i))
- }
- function i(a, e, t) {
- var n = o(),
- r = parseFloat(I) / n * 100,
- i = a / n * 100;
- e.html(B(a)), t.css("height", i + "%"), t.css("bottom", r + "%"), I = parseInt(I) + parseInt(a), i > 0 && (T = parseFloat(T) + parseFloat(i))
- }
- function o() {
- var e = h(),
- t = y(),
- n = 0;
- n = e > t ? e : t > e ? t : t;
- var r = 1e4 * Math.ceil(n / 1e4),
- i = r / 2;
- return a("#chart-max-axis-label").html(B(r)), a("#chart-half-axis-label").html(B(i)), r
- }
- function s() {
- a(".change_basicpay").html(B(Math.round(x()))), a(".change_total").html(B(Math.round(w())))
- }
- function p() {
- var e = Math.round(10 * M()) / 10,
- t = Math.round(10 * C()) / 10;
- a(".changeper_basicpay").html(e + "%"), a(".changeper_total").html(t + "%")
- }
- function l() {
- var e = parseFloat(a("#qbasicpay").val()),
- t = 1;
- t || (t = 0);
- var n = e / 100 * t,
- r = n + e;
- return isNaN(r) ? 0 : n + e
- }
- function u() {
- var e = a("#qtraining").val();
- return "na" == e ? "N/A" : training[e]
- }
- function c() {
- if (a("#qbanding").val() && "0" != a("#qbanding").val()) {
- var e = banding[a("#qbanding").val()],
- t = 80;
- return e > t && (e = t), l() / 100 * e
- }
- }
- function h() {
- return l() + c()
- }
- function v() {
- return a("#qrota").val() && "0" != a("#qrota").val() ? u() * (rotas[a("#qrota").val()].ave_hrs / 40 - 1) : void 0
- }
- function d() {
- return a("#qrota").val() && "0" != a("#qrota").val() ? u() / 40 * rotas[a("#qrota").val()].sat_pre / 3 : void 0
- }
- function g() {
- return a("#qrota").val() && "0" != a("#qrota").val() ? u() / 40 * rotas[a("#qrota").val()].sun_pre / 3 : void 0
- }
- function _() {
- return a("#qrota").val() && "0" != a("#qrota").val() ? u() / 40 * rotas[a("#qrota").val()].night_pre / 2 : void 0
- }
- function m() {
- return a("#qrota").val() && "0" != a("#qrota").val() ? u() / 100 * rotas[a("#qrota").val()].avail_pre : void 0
- }
- function f() {
- return a("#qprogramme").val() && "" != a("#qprogramme").val() ? programme_payout[a("#qprogramme").val()].supplement : 0
- }
- function q() {
- if ("F1" == a("#qtraining").val() || "F2" == a("#qtraining").val()) return 0;
- if (a("#qflexible").val() && "" != a("#qflexible").val()) {
- var e = flexible_payment[a("#qflexible").val()];
- return u() / 100 * e
- }
- return 0
- }
- function b() {
- var a = u() + v() + d() + g() + _() + m() + f() + q();
- return a < h() ? h() - a : 0
- }
- function y() {
- return u() + v() + d() + g() + _() + m() + f() + b()
- }
- function x() {
- return u() - l()
- }
- function w() {
- return y() - h()
- }
- function M() {
- return 100 * (u() / l() - 1)
- }
- function C() {
- return 100 * (y() / h() - 1)
- }
- function F() {
- if (Math.round(y()) == Math.round(h())) {
- var e = T - S,
- t = a("#graph-existing-banding-payment").height(),
- n = t + e;
- a("#graph-existing-banding-payment").height(n + "%")
- }
- }
- function j() {
- a(".hideCell").removeClass("hideCell"), a("td:empty").addClass("hideCell")
- }
- function B(a) {
- var e = !1;
- parseFloat(a) < 0 && (a = Math.abs(a), e = !0);
- var t = a.toString().split(".");
- t[0] = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
- var n = "£" + t.join(".");
- return e && (n = "-" + n), n
- }
- var N = 0,
- S = 0,
- I = 0,
- T = 0;
- a("#qgrade").on("change", function(t) {
- var n = e(a(this).val());
- a("#qbasicpay").html('<option value="">Select</option>'), a("#qbasicpay").next(".question__options").empty(), a.each(n, function(e, t) {
- a("#qbasicpay").append("<option>" + t + "</option>"), a("#qbasicpay").next(".question__options").append('<a class="question__option js-page-next" data-question="#qbasicpay" data-value="' + t + '">' + B(t) + "</a>")
- })
- }), a("select").on("change", function(a) {
- t(), n(), s(), p(), F(), j()
- }), a(".question").each(function() {
- var e = a(this).append('<div class="question__options"></div>'),
- t = e.find("select"),
- n = t.find("option"),
- r = e.find(".question__options");
- n.each(function() {
- var e = a(this);
- r.append('<a class="question__option js-page-next" data-question="#' + t.attr("id") + '" data-value="' + e.val() + '">' + e.text() + "</a>")
- })
- }), a(".questions").on("click", ".question__option", function() {
- a(this).siblings(".question__option--active").removeClass("question__option--active"), a(this).addClass("question__option--active");
- var e = a(a(this).data("question"));
- e.val(a(this).data("value")).trigger("change")
- })
- }), jQuery(document).ready(function(a) {
- function e() {
- a("html, body").animate({
- scrollTop: "0px"
- })
- }
- function t(e) {
- var t = a("#toolbar-nav").find(".active");
- "next" === e ? t.next().length && (t.removeClass("active"), t.next().addClass("active")) : t.prev().length && (t.removeClass("active"), t.prev().addClass("active"))
- }
- function n(e) {
- e.hasClass("question") ? (a("#questions").show(), a("#results").hide(), a("#toolbar-nav").show()) : e.hasClass("intro") ? (a("#calculator").hide(), a("#results").hide(), a("#intro").show()) : (a("#questions").hide(), a("#results").show(), a("#toolbar-nav").hide())
- }
- function r(e) {
- var t = e.data("title");
- t && a("#toolbar-title").text(t)
- }
- a("#questiontraining-msg").hide(), a(document).on("click", ".js-page-next", function(i) {
- var o = a(this),
- s = o.closest(".js-page"),
- p = a(s.data("next")),
- l = p.data("prev");
- if ("#qtraining" === o.data("question")) {
- if ("na" === a("#qtraining").val()) return a("#questiontraining-msg").show(), e(), !1;
- a("#questiontraining-msg").hide()
- }
- a(".js-page.active").removeClass("active"), p.addClass("active"), a(".js-page-prev").data("next", l), t("next"), n(p), r(p), e(), i.preventDefault()
- }), a(document).on("click", ".js-page-prev", function(i) {
- var o = a(this),
- s = a(o.data("next")),
- p = s.data("prev");
- a(".js-page.active").removeClass("active"), s.addClass("active"), a(".js-page-prev").data("next", p), t("prev"), n(s), r(s), e(), i.preventDefault()
- }), a(document).on("change", "#qrota", function(e) {
- var t = a(this).val();
- a(".rota").hide(), a("#rota-" + t).show()
- }), a(".js-start").on("click", function() {
- a(".js-page-prev").data("next", "#intro"), a("#intro").hide(), a("#calculator").show(), a("#question-grade").addClass("active")
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement