﻿

    function ReformatPrice(ProdPrice)
    {
        var newprodPrice;

        if (ProdPrice.length > 3)
        {
            newprodPrice = "";
            
            for (var z = 0; z < ProdPrice.length; z++)
            {
                if (z == (ProdPrice.length - 3) || z == (ProdPrice.length - 6)|| z == (ProdPrice.length - 9))
                {
                
                    newprodPrice += " ";
                }
                  newprodPrice += ProdPrice.charAt(z);
            }
        }
        else
        {
            newprodPrice = ProdPrice;
        }
        return (newprodPrice + " kr");
    }



    //+ Carlos R. L. Rodrigues
    //@ http://jsfromhell.com/classes/countdown [rev. #1]

    CountDown = function() {
        this.date = !(this.finished = this.paused = false);
    }
    CountDown.prototype.start = function(n, e, t, r) {
        var o = this;
        r ? o.onResume && o.onResume(o.n) :
    (o.n = o.date ? new Date(n).getTime() : n, o.e = o.date ? new Date(e).getTime() : e,
    o.t = t, o.finished = false, o.onStart && o.onStart(o.n));
        o.d = e < n ? 1 : -1, o.paused = false, o.i = setInterval(function() {
            o.d * (o.n -= o.d * (o.date ? 1e3 : 1)) <= o.e * o.d &&
        (o.finished = !o.stop()) && !clearInterval(o.i) ||
        o.onUpdate && o.onUpdate(o.n);
        }, (o.t || 1) * 1e3);
    }
    CountDown.prototype.pause = function(t) {
        var o = this;
        clearTimeout(o.x), o.paused ? o.start(o.n, o.e, o.t, 1) :
    (o.paused = !clearInterval(o.i), o.onPause && o.onPause(o.n),
    t && (o.x = setTimeout(function() {
        o.start(o.n, o.e, o.t, 1);
    }, t * 1e3)));
    }
    CountDown.prototype.stop = function() {
        var o = this;
        clearInterval(o.i), clearTimeout(o.x), o.onStop && o.onStop(o.n), o.n = 0;
    }


    function ChangeRowColor(row, color, cursor) {

        row.style.backgroundColor = color;

    }
