// Created by Newton Book Maker 1.1
//  Note: This file may contain needed resources !! 
// Document
book := {
	version: 2,
	isbn: "BigPicts:DTS",
	title: "The Big Picture Story",
	shortTitle: "Big Pix",
	data: {},   // Authors own data
	contents: Array(5, NIL),
	styles: [], hints: Array(5, NIL),
	browsers: [], templates: [], rendering: []};
output.book := book;

// Shared Map Functions
func MakePage(aTemplate)
	{template: aTemplate, blocks: []};
func MakeBlock(aBounds, anItem)
	{bounds: aBounds, item: anItem};

// Shared Scripts
gotoDestScript := func() begin
	if (curRendering = 0) then :TurnToPage(destPage);
	else :TurnToPage(:FindPageByContent(kioskDest, 0, NIL));
end;

// Hints
book.hints[0] := StuffHex("100020000010A0000000000000002000200000002010003C00002000000000000000000000100004002000090002000010011800000800180000003000000000000000002090200400080000200240080000000000800018208200002004100C0000000000000000000000000000000000000000000000000000000000000000",'data);
book.hints[2] := StuffHex("20944020000080000010000010001000500200100014200400002008000020880000000040100002000000280000044010120A0000410014000000002080018E008000800010300400880000022600080000000020000000200A00040010E0000000000000000000000000000000000000000000000000000000000000000000",'data);

// Text Styles
s0 := {
	family: 'Geneva,
	face: 0,
	size: 9};
AddArraySlot(book.styles, s0);

s1 := {
	family: 'Geneva,
	face: 0,
	size: 9};
AddArraySlot(book.styles, s1);

s2 := {
	family: 'NewYork,
	face: 1,
	size: 18};
AddArraySlot(book.styles, s2);

s3 := {
	family: 'Espy,
	face: 1,
	size: 9};
AddArraySlot(book.styles, s3);


// Contents
c1 := {
	data: "This is the simplest story ever told:

Once upon a time there was a little girl who added pictures to books with the greatest of ease. 
",
	styles: [39, s1, 1, s2, 97, s1]
};
book.contents[0] := c1;

c2 := {
	data: GetNamedResource("PICT", "22542", 'picture)
};
book.contents[1] := c2;

c3 := {
	data: "When pictures are too big for the screen, Newton Book Reader automatically displays scroller controls in the lower-left corner of the screenjust as on the next page in this book. 
",
	viewFont: s1
};
book.contents[2] := c3;

c4 := {
	data: "Book Reader automatically scrolls large picts",
	styles: [45, s3, 1, s1],
	layout: 16384
};
book.contents[3] := c4;

c5 := {
	data: GetNamedResource("PICT", "31580", 'picture)
};
book.contents[4] := c5;


// Kiosk (menu page) references

// Page Templates
NBMDefault := {
	nColumns: 1,
	column: [{
	width: 12,
	type: 0}]
};
AddArraySlot(book.templates, NBMDefault);
my := {
	nColumns: 1,
	column: [{
	width: 12,
	type: 0}],
	header: c4
};
AddArraySlot(book.templates, my);

// Bounds List
bnd1 := [0,16,240,87];
bnd2 := [0,87,219,269];
bnd3 := [0,269,240,318];
bnd4 := [0,16,240,194];

// Pages
pageList := {pageSize: {left: 0, top: 0, right: 240, bottom: 318},
	contents: [], pages: []};

// Page 1
page := MakePage(NBMDefault);
AddArraySlot(page.blocks, MakeBlock(bnd1, c1));
AddArraySlot(page.blocks, MakeBlock(bnd2, c2));
AddArraySlot(page.blocks,
	{bounds: bnd3,
	item: c3,
	dataLen: 180});
AddArraySlot(pageList.pages, page);

// Page 2
page := MakePage(my);
AddArraySlot(page.blocks, MakeBlock(bnd4, c5));
AddArraySlot(pageList.pages, page);

AddArraySlot(book.rendering, pageList);

// Browsers & Page Hints
b1 := {
	name: "Contents",  list: []
};
bp1 := [];		// Page Hints for list browser

AddArraySlot(book.browsers, b1);
AddArraySlot(pageList.contents, bp1);


// Indices and Sub-Indices
