timer not working in FF

This is only showing maybe one div row in FF not sure why. But works ok in IE.

<!-- body tag -->
  <div id='Timer0' 
                            style="display:none;">
                            12/27/2011 12:00:00 AM</div>
                        <div id='Timer0d'></div>
                        
                         <div id='Timer1' 
                            style="display:none;">
                           12/22/2011 12:00:00 AM</div>
                        <div id='Timer1d'></div>

     <div id='Timer2' 
                            style="display:none;">
                           12/29/2011 12:00:00 AM</div>
                        <div id='Timer2d'></div>

<!-- end body -->
<!-- script -->
Count down timer. 


    var maxTimer = 2;  /* The MaxTimer must be the same amount of rows starting at 0 */
    var nullTimers = new Array();
    function GetTimeTest(millisec) {
        function D2(val) {
            return (val < 10) ? '0' + val : val
        }
        var sec = Math.floor(millisec / 1000)
        var days = Math.floor(sec / 86400)
        sec -= days * 86400
        var hours = Math.floor(sec / 3600)
        sec -= hours * 3600
        var minutes = Math.floor(sec / 60)
        sec -= minutes * 60
        if (isNaN(parseInt(days))) {
            return ('');
        }
        else {
            return days + ' days ' + D2(hours) + ':' + D2(minutes) + ':' + D2(sec)
        } 
    }
    function CountDown() {
        var now = new Date()
        for (var i = 0; i <= maxTimer; i++) {
            div = document.getElementById('Timer' + i)
            div2 = document.getElementById('Timer' + i + 'd')
            var endDate = new Date(div.innerHTML)
            if (endDate.getTime() - now.getTime() <= 0) {
                if (!nullTimers[i]) {
                    nullTimers[i] = 1;
                    div2.innerHTML = 'Product has expired'
                }
            } else {
                div2.innerHTML = GetTimeTest(endDate.getTime() - now.getTime())
                div2 = document.all.tags('blink');
            }
            div2.innerHTML
        }
    }
    for (i = 0; i <= maxTimer; i++) nullTimers[i] = 0;
    var TimerID = setInterval('CountDown()', 1000)

Open in new window

LVL 9
Seven priceFull StackAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
This is illegal script

                div2 = document.all.tags('blink'); // no .all in Fx and no tags called blink in the code

            div2.innerHTML <<<< you need to do something here

When I remove these two lines, I get 3 countdowns in Fx

http://jsfiddle.net/mplungjan/Lx6Da/
var maxTimer = 2;  /* The MaxTimer must be the same amount of rows starting at 0 */
    var nullTimers = new Array();
    function GetTimeTest(millisec) {
        function D2(val) {
            return (val < 10) ? '0' + val : val
        }
        var sec = Math.floor(millisec / 1000)
        var days = Math.floor(sec / 86400)
        sec -= days * 86400
        var hours = Math.floor(sec / 3600)
        sec -= hours * 3600
        var minutes = Math.floor(sec / 60)
        sec -= minutes * 60
        if (isNaN(parseInt(days))) {
            return ('');
        }
        else {
            return days + ' days ' + D2(hours) + ':' + D2(minutes) + ':' + D2(sec)
        }
    }
    function CountDown() {
        var now = new Date()
        for (var i = 0; i <= maxTimer; i++) {
            div = document.getElementById('Timer' + i)
            div2 = document.getElementById('Timer' + i + 'd')
            var endDate = new Date(div.innerHTML)
            if (endDate.getTime() - now.getTime() <= 0) {
                if (!nullTimers[i]) {
                    nullTimers[i] = 1;
                    div2.innerHTML = 'Product has expired'
                }
            } else {
                div2.innerHTML = GetTimeTest(endDate.getTime() - now.getTime())
            }
        }
    }
    for (i = 0; i <= maxTimer; i++) nullTimers[i] = 0;
    var TimerID = setInterval(CountDown, 1000)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seven priceFull StackAuthor Commented:
tks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.