Android-Esque Time Entry Widget doesn't work when minutes section is below ten
<p>I'm trying to make a "widget" used for controlled time entry that uses up and down arrows to increment each section in addition to allowing you to type the values in by hand.  It worked fine(looping over from 12 to 1 and 59 to 1 ect.), but when I added a section that formatted the minutes properly when the value was below 10, it started acting up.</p>

<p>Pressing down acts normally until 10 where it displays, "10" then "09" then "0-1".</p>

<p>Pressing up after you get to "0-1" goes to "01" but when you get to "08", it goes back to "01".</p>

<pre><code>function minFix(mins)
{
if ( mins &lt;= 9)
    {
        mins = "0" + String(mins);
        document.getElementById("mins").value = mins;
    }
else
    {
        document.getElementById("mins").value = mins;
    }
}


function minUp()
{
var mins = parseInt(document.getElementById("mins").value);
if (mins == 59)
    {
        mins = 1;
        minFix(mins);
    }
else
    {
        mins = (mins+1);
        minFix(mins);
    }
}


function minDown()
{
var mins = parseInt(document.getElementById("mins").value);
if (mins == 1)
    {
        mins = 59;
        minFix(mins);
    }
else
    {
        mins = (mins-1);    
        minFix(mins);   
    }
</code></pre>

<p>}</p>

<p>The minUp and minDown are called by the up and down arrows respectively and the textbox that displays mins has an ID of mins.  </p>

<p>I'm sure I'm missing something simple but I can't figure it out right now so any help would be much appreciated.</p>
