Created
May 28, 2015 17:50
-
-
Save flexgrip/05366df4c640f67d457d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var e = new Array; | |
e[0] = "bastards"; | |
e[1] = "fakes"; | |
e[2] = "mongrels"; | |
e[3] = "phonies"; | |
e[4] = "shams"; | |
e[5] = "sharks"; | |
e[6] = "swindlers"; | |
e[7] = "jerks"; | |
var t = Math.floor(Math.random() * e.length); | |
var n = Math.floor(Math.random() * e.length); | |
$("span.randWord").html(e[t]); | |
$("span.randWord2").html(e[n]); | |
$(".slideclick").click(function() { | |
$("div.advanced").slideToggle("fast") | |
}); | |
$("#calculatebutton").click(function() { | |
function d(e, t, n) { | |
var r = e * t + n; | |
var i = e - r; | |
return { | |
fee: r, | |
total: i | |
} | |
} | |
function v(e, t, n) { | |
var r = (100 - t) / 100; | |
var i = (e + n) / r; | |
var s = i - e; | |
return { | |
fee: i, | |
total: s | |
} | |
} | |
$("div.ad").hide(); | |
$("div.resultSlide").slideDown("fast"); | |
var e = parseFloat($("#amount").val()); | |
var t = d(e, .029, .3); | |
$("div.left strong.result1").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult1").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .025, .3); | |
$("div.left strong.result2").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult2").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .022, .3); | |
$("div.left strong.result3").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult3").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .022, .3); | |
$("div.left strong.result4").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult4").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .05, .05); | |
$("div.left strong.result5").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult5").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .031, .3); | |
$("div.left strong.result6").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult6").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .027, .3); | |
$("div.left strong.result7").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult7").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .024, .3); | |
$("div.left strong.result8").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult8").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .027, 0); | |
$("div.left strong.result9").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult9").html("$" + t.fee.toFixed(2)); | |
var t = d(e, .035, .15); | |
$("div.left strong.result10").html("$" + t.total.toFixed(2)); | |
$("div.left strong.feeResult10").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.9, .3); | |
$("div.rightCol strong.result1").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult1").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.5, .3); | |
$("div.rightCol strong.result2").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult2").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.2, .3); | |
$("div.rightCol strong.result3").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult3").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.2, .3); | |
$("div.rightCol strong.result4").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult4").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 5, .05); | |
$("div.rightCol strong.result5").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult5").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 3.1, .3); | |
$("div.rightCol strong.result6").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult6").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.7, .3); | |
$("div.rightCol strong.result7").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult7").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.4, .3); | |
$("div.rightCol strong.result8").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult8").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 2.7, 0); | |
$("div.rightCol strong.result9").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult9").html("$" + t.fee.toFixed(2)); | |
var t = v(e, 3.5, .15); | |
$("div.rightCol strong.result10").html("$" + t.total.toFixed(2)); | |
$("div.rightCol strong.feeResult10").html("$" + t.fee.toFixed(2)); | |
var n = "$" + e.toFixed(2); | |
$("strong.highlightedUser1").text(n); | |
var r = $("div.left strong.result" + 1).text(); | |
$("h5.highlightedResult1").text(r); | |
var i = $("div.left strong.feeResult" + 1).text(); | |
$("strong.highlightedFee1").text(i); | |
var s = "$" + e.toFixed(2); | |
$("strong.highlightedUser2").text(s); | |
var o = $("div.rightCol strong.feeResult" + 1).text(); | |
$("h5.highlightedResult2").text(o); | |
var u = $("div.rightCol strong.result" + 1).text(); | |
$("strong.highlightedFee2").text(u); | |
var a = d(e, .029, .3); | |
var f = d(e, .0191, .05); | |
var l = a.fee.toFixed(2) - f.fee.toFixed(2); | |
$("strong.baseRates1").text(l.toFixed(2)); | |
var c = v(e, 2.9, .3); | |
var h = v(e, 1.91, .05); | |
var p = c.total.toFixed(2) - h.total.toFixed(2); | |
$("strong.baseRates2").text(p.toFixed(2)); | |
$(".highlightedUser1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".highlightedResult1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".highlightedFee1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".highlightedUser2").priceFormat({ | |
prefix: "$" | |
}); | |
$(".highlightedResult2").priceFormat({ | |
prefix: "$" | |
}); | |
$(".highlightedFee2").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result2").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result3").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result4").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result5").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result6").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result7").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result8").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result9").priceFormat({ | |
prefix: "$" | |
}); | |
$(".result10").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult2").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult3").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult4").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult5").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult6").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult7").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult8").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult9").priceFormat({ | |
prefix: "$" | |
}); | |
$(".feeResult10").priceFormat({ | |
prefix: "$" | |
}); | |
$(".baseRates1").priceFormat({ | |
prefix: "$" | |
}); | |
$(".baseRates2").priceFormat({ | |
prefix: "$" | |
}); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment