/*
Countdown and scripts (c) 2004-2006 James Hoadley, HyneeHoadley AT hotmail DOT com,
Licensed to www.FIHS.net
*/

// Overall config class
// var events_array should be array of EventClass, see below.
function CountdownConfigClass(event_buffer,events_array,update_time,path_to_images
		/*,event_name_id,event_countdown_id,event_date_id,event_image_id*/) {
    this.EventBuffer = event_buffer;       //Time after event to show post-countdown 
    this.Events = events_array;            //See below
    this.PathToImages = path_to_images;    // Relative to the script file or HTML file that includes this script (?)
                                           // eg,
                                           // var PathToImages = 'scripts/countdown-images/';
    this.UpdateTime = update_time;         //Time between showing updated countdown
    this.DoUpdateEventInfo = true;         //Used internally by ConfigTimeout(), if true,
                                           //refresh all info, else, just the time.
    this.ActiveEventIndex = null;          //Used internally, set by CountdownInit(), updated by CountdownTimeout()
                                           //Setting to null will obviously throw an error if this code isn't working correctly.
    return this;
}

// Class EventClass for individual events
// List of events should be set by calling file a la EventClass("Event date string","Event Name")
// eg:
// var Events = new Array(  new EventClass("Mar 6, 2004 19:0:0 PST",    "2004 Australian GP", "melbourne.gif"),
//                         new EventClass("Mar 21, 2004 14:0:0 +0800", "2004 Malaysian GP", "Sepang.gif")
//                       );
// All events must be in time order, i.e., NOT SORTED by these scipts
// stall: wait at 0 until event is over
function EventClass(datestr,name,logo_img,stall) { 
    this.date = new Date(datestr);
    this.name = name;
    this.logo_img = logo_img;
    if (stall == null) {
    	stall = false;
    }
    this.stall = stall;
    return this;
}
