//	Define cSportsCalendar - Copyright (C) 2010 Charles A Upsdell, All Rights Reserved; www.upsdell.com


// Declare class with default properties

function cSportsCalendar ( aPeriod )
{
this.news = new Object();
this.coming = new Object();
this.games = new Object();
this.calendar = new Object();
// Our Team
this.ourTeam = 'Mississauga Majors';
this.ourTeamLevel = '';
this.ourSeason = 2010;
// Arguments
this.period = aPeriod;
// Filename Prefix
this.filenamePrefix = '';
// Events:
this.eventData = new cTable( 'kal.eventData' );
this.eventData.addColumn( '-', 'E2', 'E', 'N', 'N!', 'C', 'H', 'P', 'P!', 'GXH', 'GXA', 'GRH', 'GRA', 'GTH', 'GTA', 'GSH', 'GSA', 'T', 'S' );
this.eventData.addColumn( 'none', 'event', 'event', 'event', 'event', 'celebration', 'holiday', 'practice', 'practice', 'game home', 'game away', 'game home', 'game away', 'game home tournament', 'game away tournament', 'game home tournament', 'game away tournament', 'game home tournament', 'game home tournament' );
// Calendars:
this.buttonAttrHTML = '.png" width="43" height="32" alt="';
if ( isMobileDevice() )
	this.buttonAttrHTML = 'M.png" width="31" height="23" alt="';
this.buttonGridModeHTML  = '"../img/but_gridmode' + this.buttonAttrHTML + 'Grid mode" title="Grid mode" ';
this.buttonListModeHTML  = '"../img/but_listmode' + this.buttonAttrHTML + 'List mode" title="List mode" ';
this.buttonNextMonthHTML = '"../img/but_nextmonth' + this.buttonAttrHTML + 'Next month" title="Next month" ';
this.buttonPrevMonthHTML = '"../img/but_prevmonth' + this.buttonAttrHTML + 'Previous month" title="Previous month" ';
this.buttonTopOfPageHTML = '"../img/but_topofpage' + this.buttonAttrHTML + 'Top of page" title="Top of page" ';
// HTML to Generate Calendars:
this.calendar.topHTML = '';
this.calendar.hasManyMonthsOnPage = false;
this.calendar.isExtraReporting = false;
// Options to Generate Game Schedule
this.games.IEnobrHTML = ['',''];
this.games.isSplitList = true;
this.games.isShowPast = true;
this.games.headerHTML = '';
this.games.header2HTML = '<tr class="gap"><td colspan="6">&nbsp;</td></tr>\n';
this.games.topHTML = '<table summary="Games" class="calendar_games" cellspacing="0" cellpadding="0">' + this.games.headerHTML;
this.games.bottomHTML = '</table>\n';
this.games.noGamesHTML = '<p class="error indent">No games scheduled yet.</p>\n';
this.games.buttonStartHTML = '<div class="ss submenu brief noprint narrow">\n<ul style="margin-top:0;">\n<li class="th">&nbsp;HIDE/SHOW&nbsp;GAMES&nbsp;</li>\n';
this.games.buttonEndHTML = '</ul></div>\n';
this.games.buttonInsert = 'ins_buttons';
this.games.hideR = '<li><a href="" onclick="return(calendarGamesSwitch(\'-\',\'R\'));">&nbsp;Regular&nbsp</a></li>\n';
this.games.showR = '<li><a href="" onclick="return(calendarGamesSwitch(\'+\',\'R\'));"><span class="hidden">&nbsp;Regular&nbsp;</span></a></li>\n';
this.games.hideT = '<li><a href="" onclick="return(calendarGamesSwitch(\'-\',\'T\'));">&nbsp;Tournament&nbsp;</a></li>\n';
this.games.showT = '<li><a href="" onclick="return(calendarGamesSwitch(\'+\',\'T\'));"><span class="hidden">&nbsp;Tournament&nbsp;</span></a></li>\n';
this.games.hideX = '<li><a href="" onclick="return(calendarGamesSwitch(\'-\',\'X\'));">&nbsp;Exhibition&nbsp;</a></li>\n';
this.games.showX = '<li><a href="" onclick="return(calendarGamesSwitch(\'+\',\'X\'));"><span class="hidden">&nbsp;Exhibition&nbsp;</span></a></li>\n';
this.games.hideP = '<li><a href="" onclick="return(calendarGamesSwitch(\'-\',\'P\'));">&nbsp;Past&nbsp;</a></li>\n';
this.games.showP = '<li><a href="" onclick="return(calendarGamesSwitch(\'+\',\'P\'));"><span class="hidden">&nbsp;Past&nbsp;</span></a></li>\n';
// Season Record Data:
this.games.estimatedGames = [ 0, 0 ];
this.games.seasonRecord = [ 'ins_games_1', 'ins_games_2' ];
this.games.trophyID = 'ins_trophies';
this.games.trophySection = '<h4>Tournaments: <span class="screen"><span class="gold">Winners(%0)</span> &#8211; <span class="silver">Finalists(%1)</span> &#8211; <span class="bronze">Semifinalists(%2)</span></span></h4>\n';
this.games.trophy1 = [ 0, '<img src="../../img/ico_gold.png" width="17" height="16" class="icon" title="Winner%1 %0 time%1" alt=Winner %0 time%1" />' ];
this.games.trophy2 = [ 0, '<img src="../../img/ico_silver.png" width="17" height="16" class="icon" title="Finalist%1 %0 time%1" alt="Finalist %0 time%1" />' ];
this.games.trophy3 = [ 0, '<img src="../../img/ico_bronze.png" width="17" height="16" class="icon" title="Semifinalist%1 %0 time%1" alt="Semifinalist %0 time%1" />' ];
this.games.trophy0 = [ 0, '<img src="../../img/ico_no_trophy_yet.png" width="17" height="16" class="icon" alt=" " />' ];
this.games.isBarCharts = true;
// News Data
this.news.insert = [ 'ins_news', 'ins_upcoming', 'ins_updated' ];
this.news.ignore = [ '-', 'E', 'E2', 'C', 'H', 'P', 'P!' ];
this.news.period = [ 10, 10 ];
this.news.trailerHTML = '<p class="subnote">Come here often for breaking news. See the <a href="archive.htm">News Archive</a> for special news reports, and the <a href="help.htm">Help<\/a> page for tips on using this site.</p>\n';
this.news.unreportedDays = 3;
this.coming.ignore = [ '-', 'E2', 'N', 'N!', 'H' ];
this.coming.gapHTML = '<div class="calUpcomingGap" style="margin-top:0.67em; margin-bottom:0.67em;"><img src="../img2004/ico_upcoming_gap.png" width="20%" height="1" style="display:block; margin-left:auto; margin-right:auto;" alt="-" /></div>\n';
this.coming.isListTournamentGames = false;
if ( (typeof(oPageStyle.aCookie.CalUpcoming) != 'undefined') && (oPageStyle.aCookie.CalUpcoming == 0) && !isMobileDevice() )
	this.coming.isListTournamentGames = true;
this.coming.noComingHTML = '<p><strong>None yet.</strong></p>\n';
this.news.isNoXScore = false;
this.coming.seeSR = '; see its tournament page for details';
// Other
this.eventConflictStylingHTML = ' class="event_conflict"';
this.eventConflictGameTime = 135;
this.isHighLowScores = false;
this.isUsThemScores = false;
this.update();
}

cSportsCalendar.prototype.update = function ( )
{
this.periodSeason = this.period;
this.coming.trailerHTML = '<p class="subnote screen">This lists coming events, including all events for the next ' + this.news.period[1] + ' days. See the <a href="calendar.htm#ThisMonth">calendar</a> for other events.</p>\n';
}

