function showDate() {
    document.write('Updated: June 14, 2009');
}

function showDropDown() 
{
    document.write(
    
    '<ul id="nav">\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><a href="index.html"><img src="graphics/menu_home.gif" width=100 height=30></a></li>\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><img src="graphics/menu_reunion.gif" width=100 height=30>\
            <ul class=reunion>\
                <li class=reunion><a href="next.html">Next WSC Family Reunion</a></li>\
                <li class=reunion><a href="prev.html">Previous WSC Reunions</a></li>\
            </ul>\
        </li>\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><img src="graphics/menu_family.gif" width=100 height=30>\
            <ul class=family>\
                <li class=family><a href="awards.html">Award Recipients</a></li>\
                <li class=family><a href="family_tree.html">Family Tree</a></li>\
                <li class=family><a href="family_group_sheets.html">Family Group Sheets</a></li>\
                <li class=family><a href="hist.html">Historical Info &amp Documents</a></li>\
            </ul>\
        </li>\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><img src="graphics/menu_photos.gif" width=100 height=30>\
            <ul class=photos>\
                <li class=photos><a href="pics_unrecognized.html">Unrecognized Pictures</a></li>\
                <li class=photos><a href="pics_reunion.html">Reunion Pictures</a></li>\
                <li class=photos><a href="pics_family.html">Family Pictures</a></li>\
                <li class=photos><a href="pics_events.html">Family Events</a></li>\
            </ul>\
        </li>\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><img src="graphics/menu_links.gif" width=100 height=30>\
            <ul class=links>\
                <li class=links><a href="http://www.royal-swinton-society.org/The_Story.chtml" target="_blank">Swinton Society</a></li>\
                <li class=links><a href="http://maps.yahoo.com/maps_result?ed=M7tNO.p_0TqT&csz=Darlington%2C+SC&country=us&new=1&name=&qty=" target="_blank">Darlington Map</a></li>\
                <li class=links><a href="http://www.darcosc.com/HistoricalCommission/" target="_blank">Darlington Historical Commission</a></li>\
            </ul>\
        </li>\
        <li style="list-style:none;margin : 0px 0px -4px 0px;"><img src="graphics/menu_graphics.gif" width=100 height=30>\
            <ul class=graphics>\
                <li class=graphics><a href="graphics_2002.html">2002 Graphic</a></li>\
                <li class=graphics><a href="graphics_2004.html">2004 Graphic</a></li>\
                <li class=graphics><a href="graphics_2005.html">2005 Graphic</a></li>\
            </ul>\
        </li>\
    </ul>'
    
    );
}

function showTitle()
{
    document.write('Wingate - Swinton - Charles');
    //document.write('<img src=graphics/wsc_title.jpg width=760 height=55>');
}

function showSubTitle()
{
    document.write(
        '<table style="margin:auto; width:400px;" cellspacing=0><tr>\
         <td style="width:50%; color:#00003B;background-color : #B0E0E5;font : bold 12px Verdana, Arial, Helvetica, sans-serif;text-align:left;">The Family Reunion Website</td>\
         <td style="width:50%; color:#00003B;background-color : #B0E0E5;font : bold 12px Verdana, Arial, Helvetica, sans-serif;text-align:right;">' + showToday2() +'</td></tr></table>' 
    );
}

function startList() 
{
    if (document.all&&document.getElementById) {
        navRoot = document.getElementById("nav");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {
                node.onmouseover=function() {
                    this.className+=" over";
                    //alert("mouseover: " + this.className); 
                }
                node.onmouseout=function() {
                    this.className=this.className.replace(" over", "");
                    //alert("mouseout: " + this.className);
                }
            }
        }
    }
}

var weekday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

function remaining_days()
{
    var ms_in_day = 86400000;          // the number of milliseconds in a day
    var today = new Date();            // the current day, today
    today.setHours(0); today.setMinutes(0); today.setSeconds(0); // zero out the time of day, making it midnight
    var r_day = new Date(2005, 6, 29); // July 29, 2005, day the reunion starts
    //var r_day = new Date("July 29, 2005 00:00:00"); // alternate way of setting reunion date
    var today_ms = today.getTime();    // convert today into milliseconds
    var r_day_ms = r_day.getTime();    // convert reunion day into milliseconds
    var remaining_ms = r_day_ms - today_ms; // subtract the reunions ms from today's ms
    var remaining_days = Math.ceil(remaining_ms / ms_in_day);  // convert milliseconds into days
    document.write(remaining_days); // print the number of days
}

function showToday2()
{
    var t = new Date();
    var day = t.getDay();
    var dt = t.getDate();
    var mo = t.getMonth();
    var yr = t.getFullYear();
    var timeString = months[mo]+" "+ dt +", "+ yr + " (" + weekday[day] + ")";
    return (timeString);
}
function showToday()
{
    var t = new Date();
    var day = t.getDay();
    var dt = t.getDate();
    var mo = t.getMonth();
    var yr = t.getFullYear();
    var timeString = months[mo]+" "+ dt +", "+ yr + " (" + weekday[day] + ")";
    document.write(timeString);
}

var ms_day  = 86400000;
var ms_hour =  3600000;
var ms_min  =    60000;
var ms_sec  =     1000;

var timeDifference = ( new Date(2005, 6, 29, 17, 0, 0).getTime() - new Date().getTime() );

var days = Math.floor(timeDifference / ms_day);
timeDifference %= ms_day;
var hours = Math.floor(timeDifference / ms_hour);
timeDifference %= ms_hour;
var mins = Math.floor(timeDifference / ms_min);
timeDifference %= ms_min;
var secs = Math.floor(timeDifference / ms_sec);
timeDifference %= ms_sec;
var msecs = timeDifference;

function counter()
{
    secs--;
    if (secs  == -1) { secs  = 59;  mins--;  }
    if (mins  == -1) { mins  = 59;  hours--; }
    if (hours == -1) { hours = 23;  days--;  }
    var total = '&nbsp;&nbsp;' + days + '  days&nbsp; ' + hours + ' hrs&nbsp; ' + mins + ' min&nbsp; ' + secs + ' sec ';
    document.all.timespan.innerHTML = total;
    window.setTimeout( 'counter()', 985 ); // make interval short than one second
}

// for background color change
var colorindex = 0;
var backcolors = new Array("#00003B", "#003B00", "#3B0000", "#000000");

function getColor()
{
    var mycolor = backcolors[colorindex++]; 
    if (colorindex == backcolors.length) { colorindex = 0; }
    return mycolor;
}
