var ddwindowlinks = {
    excludedomains: ["egrandprix.com","egrandprix.com","www.egrandprix.com","109.228.16.179","109.228.18.209","109.228.18.206","localhost","127.0.0.1"],
    linktarget: "_blank",
    mode: "auto",
    toggleHTML: "",
    persist: false,
    assigntarget: function () {
        var a = RegExp(this.excludedomains.join("|"), "i"),
            b = document.getElementsByTagName("a");
        if (this.mode == "auto" || this.mode == "manual" && this.togglebox.checked) for (var c = 0; c <= b.length - 1; c++) {
            if (b[c].hostname.search(a) == -1 && b[c].href.indexOf("http:") != -1) b[c].target = ddwindowlinks.linktarget
        } else
        for (c = 0; c <= b.length - 1; c++) b[c].target = "";
        if (this.mode == "manual" && this.persist) this.setCookie("dlinktarget", this.togglebox.checked ? "yes" : "no", -1)
    },
    init: function () {
        if (document.getElementById && this.mode == "manual") {
            document.write(this.toggleHTML);
            this.togglebox = document.getElementById("targetcheckbox");
            this.togglebox.onclick = function () {
                ddwindowlinks.assigntarget()
            };
            if (this.persist && this.getCookie("dlinktarget") != "") this.togglebox.checked = this.getCookie("dlinktarget") == "yes" ? true : false
        }
        if (window.addEventListener) window.addEventListener("load", function () {
            ddwindowlinks.assigntarget()
        }, false);
        else window.attachEvent && window.attachEvent("onload", function () {
            ddwindowlinks.assigntarget()
        })
    },
    getCookie: function (a) {
        a = RegExp(a + "=[^;]+", "i");
        if (document.cookie.match(a)) return document.cookie.match(a)[0].split("=")[1];
        return ""
    },
    setCookie: function (a, b, c) {
        var d = new Date;
        d.setDate(d.getDate() + parseInt(c));
        document.cookie = a + "=" + b + "; expires=" + d.toGMTString() + "; path=/"
    }
};
ddwindowlinks.init();
if (typeof dd_domreadycheck == "undefined") var dd_domreadycheck = false;
var dropmenumenu = {
    menusmap: {},
    preloadimages: [],
    effects: {
        delayhide: 0,
        shadow: {
            enabled: true,
            opacity: 0.3,
            depth: [5, 5]
        },
        fade: {
            enabled: false,
            duration: 500
        }
    },
    dimensions: {},
    getoffset: function (a, b) {
        return a.offsetParent ? a[b] + this.getoffset(a.offsetParent, b) : a[b]
    },
    getoffsetof: function (a) {
        a._offsets = {
            left: this.getoffset(a, "offsetLeft"),
            top: this.getoffset(a, "offsetTop"),
            h: a.offsetHeight
        }
    },
    getdimensions: function (a) {
        this.dimensions = {
            anchorw: a.anchorobj.offsetWidth,
            anchorh: a.anchorobj.offsetHeight,
            docwidth: (window.innerWidth || this.standardbody.clientWidth) - 20,
            docheight: (window.innerHeight || this.standardbody.clientHeight) - 15,
            docscrollx: window.pageXOffset || this.standardbody.scrollLeft,
            docscrolly: window.pageYOffset || this.standardbody.scrollTop
        };
        if (!this.dimensions.dropmenuw) {
            this.dimensions.dropmenuw = a.dropmenu.offsetWidth;
            this.dimensions.dropmenuh = a.dropmenu.offsetHeight
        }
    },
    isContained: function (a, b) {
        b = window.event || b;
        for (var c = b.relatedTarget || (b.type == "mouseover" ? b.fromElement : b.toElement); c && c != a;) try {
            c = c.parentNode
        } catch (d) {
            c = a
        }
        return c == a ? true : false
    },
    setopacity: function (a, b) {
        a.style.opacity = b;
        if (typeof a.style.opacity != "string") {
            a.style.MozOpacity = b;
            if (a.filters) a.style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=" + b * 100 + ")"
        }
    },
    showmenu: function (a) {
        var b = dropmenumenu.menusmap[a];
        clearTimeout(b.hidetimer);
        this.getoffsetof(b.anchorobj);
        this.getdimensions(b);
        var c = b.anchorobj._offsets.left + (b.orientation == "lr" ? this.dimensions.anchorw : 0),
            d = b.anchorobj._offsets.top + this.dimensions.anchorh - (b.orientation == "lr" ? this.dimensions.anchorh : 0);
        if (c + this.dimensions.dropmenuw + this.effects.shadow.depth[0] > this.dimensions.docscrollx + this.dimensions.docwidth) c = c - this.dimensions.dropmenuw + (b.orientation == "lr" ? -this.dimensions.anchorw : this.dimensions.anchorw);
        if (d + this.dimensions.dropmenuh > this.dimensions.docscrolly + this.dimensions.docheight) d = Math.max(d - this.dimensions.dropmenuh - (b.orientation == "lr" ? -this.dimensions.anchorh : this.dimensions.anchorh), this.dimensions.docscrolly);
        if (this.effects.fade.enabled) {
            this.setopacity(b.dropmenu, 0);
            this.effects.shadow.enabled && this.setopacity(b.shadow, 0)
        }
        b.dropmenu.setcss({
            left: c + "px",
            top: d + "px",
            visibility: "visible"
        });
        this.effects.shadow.enabled && b.shadow.setcss({
            left: c + dropmenumenu.effects.shadow.depth[0] + "px",
            top: d + dropmenumenu.effects.shadow.depth[1] + "px",
            visibility: "visible"
        });
        if (this.effects.fade.enabled) {
            clearInterval(b.animatetimer);
            b.curanimatedegree = 0;
            b.starttime = (new Date).getTime();
            b.animatetimer = setInterval(function () {
                dropmenumenu.revealmenu(a)
            }, 20)
        }
    },
    revealmenu: function (a) {
        a = dropmenumenu.menusmap[a];
        var b = (new Date).getTime() - a.starttime;
        if (b < this.effects.fade.duration) {
            this.setopacity(a.dropmenu, a.curanimatedegree);
            this.effects.shadow.enabled && this.setopacity(a.shadow, a.curanimatedegree * this.effects.shadow.opacity)
        } else {
            clearInterval(a.animatetimer);
            this.setopacity(a.dropmenu, 1);
            a.dropmenu.style.filter = ""
        }
        a.curanimatedegree = (1 - Math.cos(b / this.effects.fade.duration * Math.PI)) / 2
    },
    setcss: function (a) {
        for (prop in a) this.style[prop] = a[prop]
    },
    setcssclass: function (a, b, c) {
        var d = RegExp("(^|\\s+)" + b + "($|\\s+)", "ig");
        if (c == "check") return d.test(a.className);
        else if (c == "remove") a.className = a.className.replace(d, "");
        else if (c == "add" && !d.test(a.className)) a.className += " " + b
    },
    hidemenu: function (a) {
        a = dropmenumenu.menusmap[a];
        clearInterval(a.animatetimer);
        a.dropmenu.setcss({
            visibility: "hidden",
            left: 0,
            top: 0
        });
        a.shadow.setcss({
            visibility: "hidden",
            left: 0,
            top: 0
        })
    },
    getElementsByClass: function (a) {
        if (document.querySelectorAll) return document.querySelectorAll("." + a);
        else {
            a = RegExp("(^|\\s+)" + a + "($|\\s+)", "i");
            for (var b = [], c = document.all ? document.all : document.getElementsByTagName("*"), d = 0; d < c.length; d++) if (typeof c[d].className == "string" && c[d].className.search(a) != -1) b[b.length] = c[d];
            return b
        }
    },
    addDiv: function (a, b, c) {
        var d = document.createElement("div");
        if (a) d.id = a;
        d.className = b;
        if (c != "" && typeof d.style.cssText == "string") d.style.cssText = c;
        else c != "" && d.setAttribute("style", c);
        document.body.appendChild(d);
        return d
    },
    getmenuHTML: function (a) {
        for (var b = [], c = "", d = 0; d < a.items.length; d++) {
            c += '<li><a href="' + a.items[d][1] + '" target="' + a.linktarget + '">' + a.items[d][0] + "</a></li>\n";
            if (a.items[d][2] == "efc" || d == a.items.length - 1) {
                b.push(c);
                c = ""
            }
        }
        if (typeof a.cols == "undefined") return "<ul>\n" + b.join("") + "\n</ul>";
        else {
            c = "";
            for (d = 0; d < b.length; d++) c += '<div class="' + a.cols.divclass + '" style="' + a.cols.inlinestyle + '">\n<ul>\n' + b[d] + "</ul>\n</div>\n";
            return c
        }
    },
    addEvent: function (a, b, c) {
        if (a.length > 0) {
            var d = a.shift();
            if (d.addEventListener) d.addEventListener(c, b, false);
            else d.attachEvent && d.attachEvent("on" + c, function () {
                return b.call(d, window.event)
            });
            this.addEvent(a, b, c)
        }
    },
    domready: function (a) {
        if (dd_domreadycheck) a();
        else {
            if (document.addEventListener) document.addEventListener("DOMContentLoaded", function () {
                document.removeEventListener("DOMContentLoaded", arguments.callee, false);
                a();
                dd_domreadycheck = true
            }, false);
            else document.attachEvent && document.documentElement.doScroll && window == window.top &&
            function () {
                if (!dd_domreadycheck) {
                    try {
                        document.documentElement.doScroll("left")
                    } catch (b) {
                        setTimeout(arguments.callee, 0);
                        return
                    }
                    a();
                    dd_domreadycheck = true
                }
            }();
            document.attachEvent && parent.length > 0 && this.addEvent([window], function () {
                a()
            }, "load")
        }
    },
    addState: function (a, b) {
        if (a.getAttribute("data-image")) {
            var c = a.tagName == "IMG" ? a : a.getElementsByTagName("img")[0];
            if (c) c.src = b == "add" ? a.getAttribute("data-overimage") : a.getAttribute("data-image")
        } else dropmenumenu.setcssclass(a, "selectedanchor", b)
    },
    addState: function (a, b) {
        if (a.getAttribute("data-image")) {
            var c = a.tagName == "IMG" ? a : a.getElementsByTagName("img")[0];
            if (c) c.src = b == "add" ? a.getAttribute("data-overimage") : a.getAttribute("data-image")
        } else dropmenumenu.setcssclass(a, "selectedanchor", b)
    },
    setupmenu: function (a, b, c) {
        this.standardbody = document.compatMode == "CSS1Compat" ? document.documentElement : document.body;
        var d = b.getAttribute("rel");
        dropmenuid = d.replace(/\[(\w+)\]/, "");
        var f = window[dropmenuid],
            h = this.addDiv(null, f.divclass, f.inlinestyle);
        h.innerHTML = this.getmenuHTML(f);
        b = this.menusmap[a + c] = {
            id: a + c,
            anchorobj: b,
            dropmenu: h,
            revealtype: d.length != dropmenuid.length && RegExp.$1 == "click" ? "click" : "mouseover",
            orientation: b.getAttribute("rev") == "lr" ? "lr" : "ud",
            shadow: this.addDiv(null, "dropmenushadow", null)
        };
        b.anchorobj._internalID = a + c;
        b.anchorobj._isanchor = true;
        b.dropmenu._internalID = a + c;
        b.shadow._internalID = a + c;
        b.dropmenu.setcss = this.setcss;
        b.shadow.setcss = this.setcss;
        b.shadow.setcss({
            width: b.dropmenu.offsetWidth + "px",
            height: b.dropmenu.offsetHeight + "px"
        });
        this.setopacity(b.shadow, this.effects.shadow.opacity);
        this.addEvent([b.anchorobj, b.dropmenu, b.shadow], function (g) {
            var e = dropmenumenu.menusmap[this._internalID];
            if (this._isanchor && e.revealtype == "mouseover" && !dropmenumenu.isContained(this, g)) {
                dropmenumenu.showmenu(e.id);
                dropmenumenu.addState(this, "add")
            } else typeof this._isanchor == "undefined" && clearTimeout(e.hidetimer)
        }, "mouseover");
        this.addEvent([b.anchorobj, b.dropmenu, b.shadow], function (g) {
            if (!dropmenumenu.isContained(this, g)) {
                var e = dropmenumenu.menusmap[this._internalID];
                e.hidetimer = setTimeout(function () {
                    dropmenumenu.addState(e.anchorobj, "remove");
                    dropmenumenu.hidemenu(e.id)
                }, dropmenumenu.effects.delayhide)
            }
        }, "mouseout");
        this.addEvent([b.anchorobj, b.dropmenu], function (g) {
            var e = dropmenumenu.menusmap[this._internalID];
            if (this._isanchor && e.revealtype == "click") {
                if (e.dropmenu.style.visibility == "visible") dropmenumenu.hidemenu(e.id);
                else {
                    dropmenumenu.addState(this, "add");
                    dropmenumenu.showmenu(e.id)
                }
                g.preventDefault && g.preventDefault();
                return false
            } else e.hidetimer = setTimeout(function () {
                dropmenumenu.hidemenu(e.id)
            }, dropmenumenu.effects.delayhide)
        }, "click")
    },
    init: function (a) {
        this.domready(function () {
            dropmenumenu.trueinit(a)
        })
    },
    trueinit: function (a) {
        for (var b = this.getElementsByClass(a), c = this.preloadimages, d = 0; d < b.length; d++) {
            if (b[d].getAttribute("data-image")) {
                c[c.length] = new Image;
                c[c.length - 1].src = b[d].getAttribute("data-image")
            }
            if (b[d].getAttribute("data-overimage")) {
                c[c.length] = new Image;
                c[c.length - 1].src = b[d].getAttribute("data-overimage")
            }
            this.setupmenu(a, b[d], d)
        }
    }
};

function newsfeed(a, b, c, d) {
    this.content = a;
    this.tickerid = b;
    this.delay = d;
    this.mouseoverBol = 0;
    this.hiddendivpointer = 1;
    document.write('<div id="' + b + '" class="' + c + '" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="' + b + '1">' + a[0] + '</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="' + b + '2">' + a[1] + "</div></div>");
    var f = this;
    if (window.addEventListener) window.addEventListener("load", function () {
        f.initialize()
    }, false);
    else if (window.attachEvent) window.attachEvent("onload", function () {
        f.initialize()
    });
    else document.getElementById && setTimeout(function () {
        f.initialize()
    }, 500)
}
newsfeed.prototype.initialize = function () {
    this.tickerdiv = document.getElementById(this.tickerid);
    this.visiblediv = document.getElementById(this.tickerid + "1");
    this.hiddendiv = document.getElementById(this.tickerid + "2");
    this.visibledivtop = parseInt(newsfeed.getCSSpadding(this.tickerdiv));
    this.visiblediv.style.width = this.hiddendiv.style.width = this.tickerdiv.offsetWidth - this.visibledivtop * 2 + "px";
    this.getinline(this.visiblediv, this.hiddendiv);
    this.hiddendiv.style.visibility = "visible";
    var a = this;
    document.getElementById(this.tickerid).onmouseover = function () {
        a.mouseoverBol = 1
    };
    document.getElementById(this.tickerid).onmouseout = function () {
        a.mouseoverBol = 0
    };
    window.attachEvent && window.attachEvent("onunload", function () {
        a.tickerdiv.onmouseover = a.tickerdiv.onmouseout = null
    });
    setTimeout(function () {
        a.animateup()
    }, this.delay)
};
newsfeed.prototype.animateup = function () {
    var a = this;
    if (parseInt(this.hiddendiv.style.top) > this.visibledivtop + 5) {
        this.visiblediv.style.top = parseInt(this.visiblediv.style.top) - 5 + "px";
        this.hiddendiv.style.top = parseInt(this.hiddendiv.style.top) - 5 + "px";
        setTimeout(function () {
            a.animateup()
        }, 50)
    } else {
        this.getinline(this.hiddendiv, this.visiblediv);
        this.swapdivs();
        setTimeout(function () {
            a.setmessage()
        }, this.delay)
    }
};
newsfeed.prototype.swapdivs = function () {
    var a = this.visiblediv;
    this.visiblediv = this.hiddendiv;
    this.hiddendiv = a
};
newsfeed.prototype.getinline = function (a, b) {
    a.style.top = this.visibledivtop + "px";
    b.style.top = Math.max(a.parentNode.offsetHeight, a.offsetHeight) + "px"
};
newsfeed.prototype.setmessage = function () {
    var a = this;
    if (this.mouseoverBol == 1) setTimeout(function () {
        a.setmessage()
    }, 100);
    else {
        var b = this.hiddendivpointer;
        this.hiddendivpointer = b + 1 > this.content.length - 1 ? 0 : b + 1;
        this.hiddendiv.innerHTML = this.content[this.hiddendivpointer];
        this.animateup()
    }
};
newsfeed.getCSSpadding = function (a) {
    return a.currentStyle ? a.currentStyle.paddingTop : window.getComputedStyle ? window.getComputedStyle(a, "").getPropertyValue("padding-top") : 0
};
var news = [];
dropmenumenu.init("menuanchorclass");
function focusx(elid){
var orig = 'Search';
if(document.getElementById(elid).value==orig){document.getElementById(elid).value='';} 
}
function blurx(elid){
var orig = 'Search';
if(document.getElementById(elid).value==''){document.getElementById(elid).value=orig;} 
}
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('8 V="#1x";8 t=G P();8 U=G P();8 v=(o.z);8 h=o.1t;m E(b,a,e,f,d,g,c){3.11=g;3.K=0;3.Z=d;3.i=10;3.w=0;3.B=1;t[t.C]=3;3.k=t.C-1;3.q="1u"+3.k;3.l=3.q+"y";4(Y c!="1n"){b.1q(m(){1v 0.5-1p.1s()})}3.A=b;3.H=1z(f);3.s=G P();1A(p=0;p<b.C;p++){3.s[p]=G 1o();3.s[p].x=b[p][0]}8 a=a+3.H*2;8 e=e+3.H*2;4(h&&v||v){o.14(\'<r R="S\'+3.k+\'" 7="X:1w;12:\'+a+"u;13:"+e+\'u;1r:1y;"><r R="\'+3.q+\'y" 7="X:1f;12:\'+a+"u;13:"+e+"u;18:0;17:0;J:16:19.15.M(6=10);6:0.1;-1a-6:0.1;-1c-6:0.1;1b-1d:"+V+\'"></r><r R="\'+3.q+\'Q" 7="X:1f;12:\'+a+"u;13:"+e+"u;18:0;17:0;J:16:19.15.M(6=10);6:0.1;-1a-6:0.1;-1c-6:0.1;1b-1d:"+V+\'"></r></r>\')}j{o.14(\'<r><1m 1I="1h\'+3.k+\'" x="\'+3.s[0].x+\'"></r>\')}4(h&&v||v){3.1g()}j{3.w++;1l("t["+3.k+"].D()",3.Z)}}m 1k(a){4(a.i<L){a.i+=10;4(a.9.n&&a.9.n[0]){4(Y a.9.n[0].6=="1j"){a.9.n[0].6=a.i}j{a.9.7.J="M(6="+a.i+")"}}j{4(a.9.7.N){a.9.7.N=a.i/I}j{4(a.9.7.O){a.9.7.O=a.i/L}j{4(a.9.7.6&&!a.9.n){a.9.7.6=a.i/I}}}}}j{1L(U[a.k]);a.W=(a.l==a.q+"y")?a.q+"y":a.q+"Q";a.9=h?h[a.W]:o.z(a.W);a.T(a.9,a.B);a.B=(a.B<a.s.C-1)?a.B+1:0;1e("t["+a.k+"].D()",a.Z)}}E.F.T=m(a,c){8 b="";4(3.A[c][1]!=""){b=\'<a 1J="\'+3.A[c][1]+\'" 1K="\'+3.A[c][2]+\'">\'}b+=\'<1m x="\'+3.s[c].x+\'" 1G="\'+3.H+\'u">\';4(3.A[c][1]!=""){b+="</a>"}a.1B=b};E.F.D=m(){4(3.11==1){8 c=3}4(3.K==1){1e(m(){c.D()},L)}j{4(h&&v||v){3.1i();8 a=3.9=h?h[3.l]:o.z(3.l);a.7.1D++;U[3.k]=1l("1k(t["+3.k+"])",1H);3.l=(3.l==3.q+"y")?3.q+"Q":3.q+"y"}j{8 b=o.1E["1h"+3.k];b.x=3.s[3.w].x}}3.w=(3.w<3.s.C-1)?3.w+1:0};E.F.1i=m(){3.i=10;8 a=h?h[3.l]:o.z(3.l);4(a.n&&a.n[0]){4(Y a.n[0].6=="1j"){a.n(0).6=3.i}j{a.7.J="M(6="+3.i+")"}}j{4(a.7.N){a.7.N=3.i/I}j{4(a.7.O){a.7.O=3.i/L}j{4(a.7.6&&!a.n){a.7.6=3.i/I}}}}};E.F.1g=m(){8 a=h?h[3.l]:o.z(3.l);3.T(a,3.w);4(3.11==1){8 c=3;8 b=h?h["S"+3.k]:o.z("S"+3.k);b.1F=m(){c.K=1};b.1C=m(){c.K=0}}3.D()};',62,110,'|||this|if||opacity|style|var|tempobj||||||||iebrowser|degree|else|slideshowid|curcanvas|function|filters|document||canvasbase|div|postimages|frontarray|px|dom|curimageindex|src|_0|getElementById|theimages|nextimageindex|length|rotateimage|frontshow|prototype|new|imageborder|101|filter|mouseovercheck|100|alpha|MozOpacity|KhtmlOpacity|Array|_1|id|master|populateslide|frontclear|frontbgcolor|nextcanvas|position|typeof|delay||pausecheck|width|height|write|Microsoft|progid|left|top|DXImageTransform|moz|background|khtml|color|setTimeout|absolute|startit|defaultslide|resetit|number|frontpic|setInterval|img|undefined|Image|Math|sort|overflow|random|all|canvas|return|relative|000000|hidden|parseInt|for|innerHTML|onmouseout|zIndex|images|onmouseover|border|50|name|href|target|clearInterval'.split('|'),0,{}))
function cdLocalTime(container, servermode, offsetMinutes, targetdate, debugmode){
if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.localtime=this.serverdate=new Date(servertimestring)
this.targetdate=new Date(targetdate)
this.debugmode=(typeof debugmode!="undefined")? 1 : 0
this.timesup=false
this.localtime.setTime(this.serverdate.getTime()+offsetMinutes*60*1000) //add user offset to server time
this.updateTime()
}

cdLocalTime.prototype.updateTime=function(){
var thisobj=this
this.localtime.setSeconds(this.localtime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

cdLocalTime.prototype.displaycountdown=function(baseunit, functionref){
this.baseunit=baseunit
this.formatresults=functionref
this.showresults()
}

cdLocalTime.prototype.showresults=function(){
var thisobj=this
var debugstring=(this.debugmode)? "<p style=\"background-color: #FCD6D6; color: black; padding: 5px\"><big>Debug Mode on!</big><br /><b>Current Local time:</b> "+this.localtime.toLocaleString()+"<br />Verify this is the correct current local time, in other words, time zone of count down date.<br /><br /><b>Target Time:</b> "+this.targetdate.toLocaleString()+"<br />Verify this is the date/time you wish to count down to (should be a future date).</p>" : ""

var timediff=(this.targetdate-this.localtime)/1000 //difference btw target date and current date, in seconds
if (timediff<0){ //if time is up
this.timesup=true
this.container.innerHTML=debugstring+this.formatresults()
return
}
var oneMinute=60 //minute unit in seconds
var oneHour=60*60 //hour unit in seconds
var oneDay=60*60*24 //day unit in seconds
var dayfield=Math.floor(timediff/oneDay)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
hourfield=dayfield*24+hourfield
dayfield="n/a"
}
else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
minutefield=dayfield*24*60+hourfield*60+minutefield
dayfield=hourfield="n/a"
}
else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
var secondfield=timediff
dayfield=hourfield=minutefield="n/a"
}
this.container.innerHTML=debugstring+this.formatresults(dayfield, hourfield, minutefield, secondfield)
setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}
function addZero(num){	(String(num).length < 2) ? num = String("0" + num) :  num = String(num);	return num;		}
function add2Zero(num){	(String(num).length == 1) ? num = String("00" + num) :  num = String(num); (String(num).length == 2) ? num = String("0" + num) :  num = String(num);	return num;		}
function formatresults(){
if (this.timesup==false){//if target date/time not yet met
var displaystring="<table border=\"0\" width=\"150\"><tr class=\"countred\"><td>"+add2Zero(arguments[0])+"</td><td>:</td><td>"+addZero(arguments[1])+"</td><td>:</td><td>"+addZero(arguments[2])+"</td><td>:</td><td>"+addZero(arguments[3])+"</td></tr><tr class=\"countwhite\"><td>DAYS</td><td></td><td>HOURS</td><td></td><td>MINS</td><td></td><td>SECS</td></tr></table>"
}
else{ //else if target date/time met
var displaystring="<table border=\"0\" width=\"150\"><tr class=\"countred\" style=\"text-decoration:blink;\"><td>000</td><td>:</td><td>00</td><td>:</td><td>00</td><td>:</td><td>00</td></tr><tr class=\"countwhite\"><td>DAYS</td><td></td><td>HOURS</td><td></td><td>MINS</td><td></td><td>SECS</td></tr></table>";
}
return displaystring
}
