dateFuture = new Date(2011,4,17,10,0,5);

function GetCount(){

        dateNow = new Date();                                                                        //grab current date
        amount = dateFuture.getTime() - dateNow.getTime();                //calc milliseconds between dates
        delete dateNow;

        // time is already past
        if(amount < 0){
                document.getElementById('countbox').innerHTML="<table border = 0><tr><td colspan='4' align='center' style='font-size:16px;'><strong>Now Open! <br><a href='http://www.furnitureconsignment.com/pages/1/84/'> Chestnut Hill Store</a><br>335 Boylston Street, Newton MA</strong></td></tr><tr><td align='center'>";
        }
        // date is still good
        else{
                days=0;hours=0;mins=0;secs=0;out="";

                amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs

                days=Math.floor(amount/86400);//days
                amount=amount%86400;

                hours=Math.floor(amount/3600);//hours
                amount=amount%3600;

                mins=Math.floor(amount/60);//minutes
                amount=amount%60;

                secs=Math.floor(amount);//seconds
                out+="<table border = 0><tr><td colspan='4' align='center' style='font-size:16px;'><strong>Coming Soon! <br><a href='http://www.furnitureconsignment.com/pages/1/84/'> Chestnut Hill Store</a><br>335 Boylston Street, Newton MA</strong></td></tr><tr><td align='center'>"
                if(days != 0){out += "<font color='maroon' size='4px'>"+ days +"</font><br><font color='maroon' size='1px'> DAY"+((days!=1)?"S":"")+"</font></td><td align='center'>";}
                
                if(days != 0 || hours != 0){out += "<font color='maroon' size='4px'>"+ hours +"</font><br><font color='maroon' size='1px'> HOUR"+((hours!=1)?"S":"")+"</td><td align='center'>";}
                if(days != 0 || hours != 0 || mins != 0){out += "<font color='maroon' size='4px'>"+ mins +"</font><br><font color='maroon' size='1px'> MINUTE"+((mins!=1)?"S":"")+"</td><td align='center'>";}
                out += "<font color='maroon' size='4px'>"+secs +"</font><br><font color='maroon' size='1px'> SECONDS";
                out += "</font></td></tr></table>"
                document.getElementById('countbox').innerHTML=out;

                setTimeout("GetCount()", 1000);
        }
}

window.onload=function(){GetCount();}//call when everything has loaded

//-->

