﻿/***********************Progressive ticker***************************/
//increment the jackpot ticker
function JackpotTotals(id) {
    var itotal = 0;
    var obj = document.getElementById(id);
    if (obj != null) {
        itotal += parseFloat(obj.innerHTML.replace(/\$|\,/g, ''));
        itotal += 0.02;
        obj.innerHTML = addCommas(itotal);
        window.setTimeout("JackpotTotals('" + id + "');", 1500);
    }
}

//format the value to currency 
function addCommas(nStr) {
    nStr = Math.floor(nStr * 100 + (Math.random() * 6));
    var cents = nStr % 100;
    if (cents < 10) {
        cents = "0" + cents;
    }
    var x1 = Math.floor(nStr / 100).toString();
    var x2 = '.' + cents;
    var rgx = /(\d+)(\d{3})/;
    while (rgx.test(x1)) {
        x1 = x1.replace(rgx, '$1' + ',' + '$2');
    }
    return x1 + x2;
}
/*************************End Progressive ticker*****************************/