Hi all,
Im new to this forumn. my problem is related to javascript.
i just needto display an alert(confirm box) showing time left in session timeout. and OK option for user to continue with the session and if not alert box automatically gone
code is like

//========= time out check STARTS====
function Minutes(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(0, i));
}
function Seconds(data) {
for (var i = 0; i < data.length; i++)
if (data.substring(i, i + 1) == ":")
break;
return (data.substring(i + 1, data.length));
}
function Display(min, sec) {
var disp;
if (min <= 9) disp = " 0";
else disp = " ";
disp += min + ":";
if (sec <= 9) disp += "0" + sec;
else disp += sec;
return (disp);
}
function Down() {
sec--;
if (sec == -1) { sec = 59; min--; }
window.status = "Session will time out in: " + Display(min, sec);
if (min == 0 && sec <= 10) {
/** what to do here?? to display an alert box showing 10,9,8,7 ..
when ten seconda left in session time out **/
alert("Your Session is going to expire in "+ +" Click OK to Continue");
}
else down = setTimeout("Down()", 1000);
}
window.onload = function timeIt() {
min = 1 * Minutes('00:15');
sec = 0 + Seconds('00:15');
Down();
}
//========= timeout ENDS====