In my asp.net page I have a simple javascript function that will create a count down meter, initial value is set to seconds through "var leave =<%=seconds %>;"
originally countertimer has no parameter and everything seems to work;
But I need to add more function there: when the time is up, user will get prompt to either extend the timer or be redirected to another page.

So I tried to add a variable to the function
by changing function CounterTimer() to function CounterTimer(a) and
add a line: var leave = a;

and it seems not working because the value is not passed to inside the function by calling CounterTimer(60) or CounterTimer("60")

HTML Code:
<script type="text/javascript">

var leave =<%=seconds %>;

//CounterTimer(leave);
CounterTimer();
var interv=setInterval(CounterTimer,1000);

function CounterTimer()
{
//var leave = a;
var day = Math.floor(leave / ( 60 * 60 * 24))
var hour = Math.floor(leave / 3600) - (day * 24)
var minute = Math.floor(leave / 60) - (day * 24 *60) - (hour * 60)
var second = Math.floor(leave) - (day * 24 *60*60) - (hour * 60 * 60) - (minute*60)

hour=hour<10 ? "0" + hour : hour;
minute=minute<10 ? "0" + minute : minute;
second=second<10 ? "0" + second : second;

var remain= hour + ":" + minute+ ":" + second;
leave=leave-1;

document.getElementById("timelabel").innerHTML =remain;
if (hour == 00 && minute == 00 && second == 00)
{
if(confirm('Do you want to extend your session to another one hour?'))
    {
        CounterTimer(60);
    }
else{
       window.location="http://www.newlocation.com";//Redirect current page to another page
    }
}
}

</script>
How do I fix it?

Thank you.