// ********************************************************************************************************************
// Billboards Settings Javascript
// Version 1.0.2
//
// Date Created:  2009-02-12
// Last Modified: 2009-06-29
//
// Requires: Common v1.1+, Billboards v1.0.2+
//
// Created by MeMSO of A Far Site Better
// (c) Copyright 2009

// ------------------------------------------------------------------------------------------------
// NOTES
// Scramble Ready
// NTSCRAMBLED-Prepend="SEbB"
// ------------------------------------------------------------------------------------------------

// Check that v1.1.0+ of common.js is installed
if (typeof(INCLUDES) == 'undefined')
	alert('Error! Common v1.1.0 or higher is required!');
else if (VersionCompare('1.1.0', INCLUDES.common) == 2)
	alert('Error! Common v1.1.0 or higher is required!');
// Include common-ui.js v1.1.0+
//Include('common-ui.js', 'common_ui', '1.1.0');
// Include pages/billboards.js v1.0.2+
Include('pages/billboards.js', 'page_billboards', '1.0.2');

// Let other scripts know this file is included
INCLUDES.settings_billboards  = '1.0.2';

// ********************************************************************************************************************
// Constants



// ********************************************************************************************************************
// External Use Data
// NTSCRAMBLED-External



// ********************************************************************************************************************
// Internal Use Variables
// NTSCRAMBLED-Internal



// ####################################################################################################################
// ####################################################################################################################
// ####################################################################################################################
// Function Listing

// ********************************************************************************************************************
// Created:       v1.0.0
// Last Modified: v1.0.2
// Configures the billboard type
function Billboards_Configure(bbindex) {
	// If the billboard index is invalid, exit
	if (bbindex < 0 || bbindex >= BillboardInternal.BillboardNum)
		return;

	// Get a pointer to our billboard
	var curbb = Billboards[bbindex];

	switch (curbb.CatScriptName) {
	// ==============================================================================================
	case 'home':
		// ----------------------------------------------------------------------------------
		// General

		// Display flags
		// BITS
		// 0   0001  Use a Pause and Play button
		// 1   0002  Use a Previous and Next button
		// 2   0004  Do NOT shuffle the billboard entries first
		// 3   0008  Changing the current image automatically pauses
		curbb.DisplayFlags           = 0x0000;

		// Type of display to use:
		// 0 - Billboards Only                                                        BILLBOARD_DISPLAYTYPE_NOEXTRA
		// 1 - Use Mini Images                                                        BILLBOARD_DISPLAYTYPE_MINIIMAGES
		// 2 - Use Numbers w/ Progress Filling                                        BILLBOARD_DISPLAYTYPE_PROGRESSNUMBERS
		curbb.DisplayType            = BILLBOARD_DISPLAYTYPE_NOEXTRA;

		// Maximum number of billboards to show (0 for infinite)
		curbb.BillboardMax           = 0;

		// Class to apply to the classes
		curbb.OverlayClass           = 'BillboardOverlay';

		// Number of ms between showing billboard entries
		// Ignored with "Progress Filling" display type
		curbb.OverlaySwapTimeout     = 8000;

		// Number of ms per frame of an overlay effect
		curbb.OverlayEffectRate      = 50;
		// Number of frames for the overlay effect
		curbb.OverlayEffectFrames    = 10;

		// ID of the main billboard region
		curbb.MainRegionID           = 'HeaderSlideShow';


		// ----------------------------------------------------------------------------------
		// Control Buttons

		// ID of the outer region of the control buttons (if blank, use the outer region of the entry list)
		// This is used to hide the control buttons if there is only one billboard
		curbb.ControlButtonsOuterID  = '';

		// ID of the region to put the control buttons
		curbb.ControlButtonsID       = 'BillboardControlButtons';

		// Play button. Must have normal, mo and on images
		curbb.ImagePlay              = '';
		curbb.ImagePlayWid           = 0;
		curbb.ImagePlayHei           = 0;
		curbb.ImagePlayClass         = 'BillboardButtonPlay';

		// Pause button. Must have normal, mo and on images
		curbb.ImagePause             = '';
		curbb.ImagePauseWid          = 0;
		curbb.ImagePauseHei          = 0;
		curbb.ImagePauseClass        = 'BillboardButtonPause';

		// Previous button. Must have normal, mo and on images
		curbb.ImagePrevious          = '';
		curbb.ImagePreviousWid       = 0;
		curbb.ImagePreviousHei       = 0;
		curbb.ImagePreviousClass     = 'BillboardButtonPrevious';

		// Next button. Must have normal, mo and on images
		curbb.ImageNext              = '';
		curbb.ImageNextWid           = 0;
		curbb.ImageNextHei           = 0;
		curbb.ImageNextClass         = 'BillboardButtonNext';


		// ============================================================================================
		// Entry List Details

		// ID of the outer region of the entry list
		// This is used to hide the entry list if there is only one billboard
		curbb.EntryListOuterID       = 'BillboardEntryListOuter';

		// ID of the inner region of the entry list
		curbb.EntryListInnerID       = 'BillboardEntryList';


		// ----------------------------------------------------------------------------------
		// Mini Image Details

		// Class to use for each entry in the entry list
		curbb.EntryListEntryClass    = 'BillboardELEntry';
		// Class to use for the entry list highlight
		curbb.EntryListHighlightClass= 'BillboardELHighlight';

		// Number of ms per frame of the highlight
		curbb.HighlightEffectRate    = 100;
		// Number of frames for the highlight
		curbb.HighlightEffectFrames  = 20;


		// ----------------------------------------------------------------------------------
		// Number Progress Details

		// The outer class for progress buttons
		curbb.EntryListProgressOuterClass = 'BillboardProgressEntryOuter';
		// The class to use for the incomplete buttons
		curbb.EntryListProgressEmptyClass = 'BillboardProgressEntryEmpty';
		// The class to use for the complete buttons
		curbb.EntryListProgressFullClass = 'BillboardProgressEntryFull';

		// The width and height of the progress regions
		curbb.EntryListProgressWid      = 100;
		curbb.EntryListProgressHei      = 24;
		break;


	// ==============================================================================================
	default:
		alert('Unknown billboard type of "' + curbb.CatScriptName + '"!');


	} // switch (curbb.CatScriptName)
} // Billboards_Configure
