//	This team's JavaScript - Copyright (C) 2003-2007 Charles A Upsdell, All Rights Reserved; www.upsdell.com


//	OnLoad Function
function myOnLoad( nTimeLimit )
  {
	// Enable hovers over LI's (IE workaround)
	startList( "hormenu0", "hormenu", "navmenu" );
	myGetPhoto( 'ins_HomePagePhoto' );
	if ( typeof(cal) == 'object' )
	  {
		if ( typeof(cal.toNewsHTML) !== typeof(noSuchFunction) )
			cal.toNewsHTML();
		if ( typeof(cal.toCalendarHTML) !== typeof(noSuchFunction) )
			cal.toCalendarHTML( 'grid', 'ins_calendar_dump', window.location.hash );
		if ( typeof(cal.toGamesHTML) !== typeof(noSuchFunction) )
			cal.toGamesHTML();
		if ( typeof(calendarTournament) !== typeof(noSuchData) )
			cal.toTournamentGamesHTML( calendarTournamentID, calendarTournament );
	  }
	if ( typeof(myReportAnyBrowserUpdate) !== typeof(noSuchFunction) )
		myReportAnyBrowserUpdate( '../../../BrowserNews/', getElement('ins_BrowserUpdate') );
  }

// Function to write code to display a randomly-selected photo for home page
function myGetPhoto ( sID )
{
	var objPhoto = getElement( sID );
	if ( objPhoto == null )
		return;
	var Photo = new Array();
	Photo[Photo.length] = 'pic_pitch.jpg';
	Photo[Photo.length] = 'pic_01.jpg';
	Photo[Photo.length] = 'pic_02.jpg';
	Photo[Photo.length] = 'pic_03.jpg';
	Photo[Photo.length] = 'pic_04.jpg';
	Photo[Photo.length] = 'pic_05.jpg';
	var nImage = Math.floor( (Photo.length)*Math.random() );
	objPhoto.innerHTML = '<p style="margin-bottom:0;"><img src="img/' + Photo[nImage] + '" class="left" alt="Baseball photo" /></p>';
}

