﻿// JScript File
function set(img) {
    pic = document.getElementById(img).src;
    show = pic.substr(pic.length-5, 1);
    if (show == 0) 
    	show = pic.substr(0, pic.length-5) + "1.gif";
 	else 
 		show = pic.substr(0, pic.length-5) + "0.gif";

    document.getElementById(img).src = show;	
}

//TimeLeft
var vTimeLeft = 20.00;
var vBigPeriod = 1;
var vSmallPeriod = 0.05;
var cntTimer = document.getElementById('cntTimeLeft');

function fTimeLeft()
{	
	if (vTimeLeft <= 0.05)
	{	    
	    window.location = 'Login.aspx?t=2b98cf3f-980b-441d-89fd-7a57a80942b5'; //redirect to url;
	}
	else
	{
	    if (vTimeLeft < 6) 
    	{
	    	vPeriod = vSmallPeriod;
	    }
	    else
	    {
	    	vPeriod = vBigPeriod;
	    }
    }
    
	vTimeLeft -= vPeriod;
	fPrintTime();
	setTimeout('fTimeLeft()', vPeriod*60000);
}

function fPrintTime()
{
	cntTimer = document.getElementById('cntTimeLeft');
	if (vTimeLeft < 10) cntTimer.innerHTML = "00.0"+vTimeLeft.toFixed(2);
	else cntTimer.innerHTML = "00."+vTimeLeft.toFixed(2);
}
