
<!--
var dys1;
var hrs1;
var mins1;
var secs1;

var dys2;
var hrs2;
var mins2;
var secs2;

var dys3;
var hrs3;
var mins3;
var secs3;


/* saso
var hrs2; // days, minutes and seconds variables for each display
var mins2;
var secs2;
var hrs3;
var mins3;
var secs3;
*/
// INCLUDE A NEW MINUTES AND SECONDS VAIRABLE FOR EACH DISPLAY YOU ADD


function cd(da,ho,mi,se,da2,ho2,mi2,se2,da3,ho3,mi3,se3) // this function must be called from the <body onload=""> event
{
        tim1(da,ho,mi,se);
        tim2(da2,ho2,mi2,se2); // invokes the three timer displays functions
        tim3(da3,ho3,mi3,se3);
}


function tim1(da,ho,mi,se) // display 1 time setup
{
        dys1  = 1 * d(da); // change days here
        hrs1  = 1 * h(ho); // change Hours here
        mins1 = 1 * m(mi); // change minutes here
        secs1 = 0 + s(se); // change seconds here (always add an additional second to your total)


        if ((dys1 ==0)&&(hrs1 ==0)&&(mins1 ==0)&&(secs1 ==0))
                secs1 = 1 + s(se); // change seconds here (always add an additional second to your total)

        redo1();
}


function tim2(da,ho,mi,se) // display 2 time setup
{
        dys2  = 1 * d(da); // change days here
        hrs2  = 1 * h(ho); // change Hours here
        mins2 = 1 * m(mi); // change minutes here
        secs2 = 0 + s(se); // change seconds here (always add an additional second to your total)

        if ((dys2 ==0)&&(hrs2 ==0)&&(mins2 ==0)&&(secs2 ==0))
                secs2 = 1 + s(se); // change seconds here (always add an additional second to your total)

        redo2();
}


function tim3(da,ho,mi,se) // display 3 time setup
{
        dys3  = 1 * d(da); // change days here
        hrs3  = 1 * h(ho); // change Hours here
        mins3 = 1 * m(mi); // change minutes here
        secs3 = 0 + s(se); // change seconds here (always add an additional second to your total)

        if ((dys3 ==0)&&(hrs3 ==0)&&(mins3 ==0)&&(secs3 ==0))
                secs3 = 1 + s(se); // change seconds here (always add an additional second to your total)

        redo3();
}
// INCLUDE A NEW TIM() FUNCTION FOR EACH DISPLAY YOU ADD


//*******BEGIN NON EDITABLE*******
function d(obj)
{
        for(var i = 0; i < obj.length; i++)
        {
                if(obj.substring(i, i + 1) == " ")
                break;
        }
        return(obj.substring(0, i));
}

function h(obj)
{
        for(var i = 0; i < obj.length; i++)
        {
                if(obj.substring(i, i + 1) == " ")
                break;
        }
        return(obj.substring(0, i));
}

function m(obj)
{
        for(var i = 0; i < obj.length; i++)
        {
                if(obj.substring(i, i + 1) == " ")
                break;
        }

        return(obj.substring(0, i));
}

function s(obj)
{
        for(var i = 0; i < obj.length; i++)
        {
                if(obj.substring(i, i + 1) == " ")
                break;
        }

        return(obj.substring(i -2 , obj.length));
//        return(obj.substring(i + 1, obj.length));
}

function dis(dys, hrs, mins, secs)
{
        var disp;

        if(dys <= 9)
        {
                disp = "0" + dys + "     ";
        }
        else
        {
                disp = dys + "     ";
        }
//        disp = dys + "     "; //Determin how minuts far from days*************

        if(hrs <= 9)
        {
                disp += "0" + hrs + "     "; //Determin how minuts far from hours   *******************
        }
        else
        {
                disp += hrs + "     "; //Determin how minuts far from hours ****************
        }

        if(mins <= 9)
        {
                disp += "0" + mins + "     "; //Determin how sec far from minutes.
        }
        else
        {
                disp += mins + "     "; //Determin how sec far from minutes.
        }

        if(secs <= 9)
        {
                disp += "0" + secs;
        }
        else
        {
                disp += secs;
        }

        return(disp);
}
//*******END NON EDITABLE*******

function redo1() // redo function for display 1
{
        secs1--;

        if(secs1 == -1)
        {
                secs1 = 59;
                mins1--;
        }

        if(mins1 == -1)
        {
                mins1 = 59;
                hrs1--;
        }

        if(hrs1 == -1)
        {
                hrs1 = 24;
                dys1--;
        }



        if (dys1<0)
        {
            dys1  =0;
            hrs  =0;
            mins1 =0;
            secs1 =0;
        }

        if (hrs1<0)
        {
            hrs1  =0;
            mins1 =0;
            secs1 =0;
        }

        if (mins1<0)
        {
            mins1 =0;
            secs1 =0;
        }

        if (secs1<0)
            secs1 =0;



        document.cd1.disp1.value = dis(dys1,hrs1,mins1,secs1); // output to display 1

        if((dys1 == 0) && (hrs1 == 0) && (mins1 == 0) && (secs1 == 0))
        {
//                       window.alert("Auction End."); // change timeout message as required
                //window.location = "yourpage.htm" // redirects to specified page once timer ends and ok button is pressed

                // if your message / redirect is the same for all three timers you can enter a new function containing above code and invoke from here - do the same for the messages in redo2 and redo3        and if the timer runs out in any of the functions it will invoke the above code
        }
        else
        {
                redo = setTimeout("redo1()",1000); // 1 second loop to re-invoke function
        }
}

function redo2() // redo function for display 2
{

        secs2--;


        if(secs2 == -1)
        {
                secs2 = 59;
                mins2--;
        }

        if(mins2 == -1)
        {
                mins2 = 59;
                hrs2--;
        }

        if(hrs2 == -1)
        {
                hrs2 = 24;
                dys2--;
        }





        if (dys2<0)
        {
            dys2  =0;
            hrs2  =0;
            mins2 =0;
            secs2 =0;
        }

        if (hrs2<0)
        {
            hrs2  =0;
            mins2 =0;
            secs2 =0;
        }

        if (mins2<0)
        {
            mins2 =0;
            secs2 =0;
        }

        if (secs2<0)
            secs2 =0;





        document.cd1.disp2.value = dis(dys2,hrs2,mins2,secs2); // output to display 1

        if((dys2 == 0) && (hrs2 == 0) && (mins2 == 0) && (secs2 == 0))
        {
//            document.cd1.objectimg2.src = img2 + ".jpg";
        }
        else
        {
                redo = setTimeout("redo2()",1000); // 1 second loop to re-invoke function
        }
}

function redo3() // redo fnction for display 3
{


         secs3--;



        if(secs3 == -1)
        {
                secs3 = 59;
                mins3--;
        }

        if(mins3 == -1)
        {
                mins3 = 59;
                hrs3--;
        }

        if(hrs3 == -1)
        {
                hrs3 = 24;
                dys3--;
        }




        if (dys3<0)
        {
            dys3  =0;
            hrs3  =0;
            mins3 =0;
            secs3 =0;
        }

        if (hrs3<0)
        {
            hrs3  =0;
            mins3 =0;
            secs3 =0;
        }

        if (mins3<0)
        {
            mins3 =0;
            secs3 =0;
        }

        if (secs3<0)
            secs3 =0;


        document.cd1.disp3.value = dis(dys3,hrs3,mins3,secs3); // output to display 1

        if((dys3 == 0) && (hrs3 == 0) && (mins3 == 0) && (secs3 == 0))
        {
//            document.cd1.objectimg3.src = img3 + ".jpg";
        //                window.alert("Time is up on display 3. Press OK to continue."); // change timeout message as required
                //window.location = "yourpage.htm" // redirects to specified page once timer ends and ok button is pressed

                // if your message / redirect is the same for all three timers you can enter a new function containing above code and invoke from here - do the same for the messages in redo2 and redo3        and if the timer runs out in any of the functions it will invoke the above code
        }
        else
        {
                redo = setTimeout("redo3()",1000); // 1 second loop to re-invoke function
        }
}
// ADD A NEW REDO() FUNCTION FOR EACH DISPLAY YOU ADD

//-->

