Count Up Script
<p>I have this Football count up script</p>

<pre><code>// Class: Timer
var Timer = function (callback) {
    // Property: Frequency of elapse event of the timer in milliseconds
    this.Interval = 1000;

    // Property: Whether the timer is enable or not
    this.Enable = new Boolean(false);

    // Event: Timer tick
    this.Tick = callback;

    // Member variable: Hold interval id of the timer
    var timerId = 0;

    // Member variable: Hold instance of this class
    var thisObject;

    // Function: Start the timer
    this.Start = function () {
        this.Enable = new Boolean(true);

        thisObject = this;
        if (thisObject.Enable) {
            thisObject.timerId = setInterval(
            function () {
                thisObject.Tick();
            }, thisObject.Interval);
        }
    };

    // Function: Stops the timer
    this.Stop = function () {
        thisObject.Enable = new Boolean(false);
        clearInterval(thisObject.timerId);
    };

};

// Namespace: Match rules and timings
var Match = {

    Timers: {
        FirstHalf: new Timer(TimerTick),
        HalfTime: new Timer(TimerTick),
        SecondHalf: new Timer(TimerTick),
        TickCount: -1
    },

    Strings: {
        FirstHalf: 'First Half',
        HalfTime: 'Half Time',
        SecondHalf: 'Second Half',
        FullTime: 'Finished'
    },

    DisplayTime: function (t) {
        var m = parseInt(t / 60);
        var s = t % 60;
        return (m &lt; 10 ? '0' + m : m) + ":" + (s &lt; 10 ? '0' + s : s);
    }
};

// Function: Tick Event Handler (callback function)
function TimerTick(timer) {

    // Document elements used.
    var TimerP = document.getElementById('time');
    var DisplayP = document.getElementById('display'); 

    // During First Half
    if (Match.Timers.FirstHalf.Enable == true) {
        if (Match.Timers.TickCount == -1) { Match.Timers.TickCount = 0 }
        if (Match.Timers.TickCount == 2700) {
            Match.Timers.FirstHalf.Stop();
            Match.Timers.TickCount = -1;
            Match.Timers.HalfTime.Start();
        } else {
            TimerP.innerHTML = Match.DisplayTime(Match.Timers.TickCount);
            DisplayP.innerHTML = Match.Strings.FirstHalf;
            Match.Timers.TickCount++;
        }
    }

    // During Half Time
    else if (Match.Timers.HalfTime.Enable == true) {
        if (Match.Timers.TickCount == -1) { Match.Timers.TickCount = 0 }
        if (Match.Timers.TickCount == 900) {
            Match.Timers.HalfTime.Stop();
            Match.Timers.TickCount = -1;
            Match.Timers.SecondHalf.Start();
        } else {
            TimerP.innerHTML = '45:00';
            DisplayP.innerHTML = Match.Strings.HalfTime + ' (' + Match.DisplayTime(900 - Match.Timers.TickCount) + ')';
            Match.Timers.TickCount++;
        }
    }

    // During Second Half
    else if (Match.Timers.SecondHalf.Enable == true) {
        if (Match.Timers.TickCount == -1) { Match.Timers.TickCount = 2700 }
        if (Match.Timers.TickCount == 5400) {
            TimerP.innerHTML = '90:00';
            DisplayP.innerHTML = Match.Strings.FullTime;
            Match.Timers.SecondHalf.Stop();
            Match.Timers.TickCount = -1;
        } else {
            TimerP.innerHTML = Match.DisplayTime(Match.Timers.TickCount);
            DisplayP.innerHTML = Match.Strings.SecondHalf;
            Match.Timers.TickCount++;
        }
    }
}

function KickOff() {
    var btn = document.getElementById('btnKickOff');
    btn.setAttribute('style','display: none;');
    Match.Timers.FirstHalf.Start();
}  
</code></pre>

<p>or check it here <a href="http://pastebin.com/CkmPQ9ZV" rel="nofollow">http://pastebin.com/CkmPQ9ZV</a></p>

<p>and I have this HTML code for the script :</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
        &lt;title&gt;Simple Football Match Timer&lt;/title&gt;
        &lt;script src="timer.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;
        &lt;form id="pageForm" runat="server"&gt;
            &lt;div&gt;    
                &lt;p id="display"&gt;Waiting for kick off.&lt;/p&gt;
                &lt;p id="time"&gt;00:00&lt;/p&gt;
                &lt;input id="btnKickOff" type="button" value="Kick Off!" onclick="KickOff();" /&gt;
            &lt;/div&gt;
        &lt;/form&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>This script start counting when i click Kick off.. it counts from 0 to 45 mins after that it show HalfTime and countdown 15 mins break after 15 mins is finish it starts counting again from 45 until 90 and when it reach 90 it shows "Finished"</p>

<p>Its nice script but my problem is that i want this script not to start again after every page refresh i want to post it on my website so when users open my website they will be able to see what time the match is.. i will click it on the start of the match.. and it continue until the end</p>

<p>PS: i'm not good in Javascript.. i got help in creating this script :)</p>
