// ******************************************************************************************************************************
// *** San Juan Nature Institute Database
// ******************************************************************************************************************************

SJNI_DBobj = new Array;

// Define object prototype for SJNI database entry
function SJNI_DBentry(key, entrytype, agegroup, title, mmddyy, datestr, timestr, coststr, loc, island, prof, subject, page, cost) {
	this.key = key;						// unique key
	this.entrytype = entrytype;			// code: 'C'=Class (Workshop), 'Y'=Young Naturalist Program, 'S'=Sale Item
	this.agegroup = agegroup;			// code: 'all'=all participants, '5-7'=ages 5-7 Young Naturalists, '8-12'=ages 8-12 Young Naturalists
	this.title = title;					// class title
	this.mmddyy = mmddyy;				// class date (may be multiple dates, hypenated. e.g. mm/dd/yy-mm/dd/yy
	this.datestr = datestr;				// textual description of date string, appears on list pages and on class reservation page
	this.timestr = timestr;				// textual description of class start/end time, appears on list pages (YN only) and class registration page
	this.coststr = coststr;				// textual description of class costs, appears on class registration page
	this.loc = loc;						// venue details, appears on class registration page
	this.island = island;				// sort key on list pages, appears on list pages and on class registration page
	this.prof = prof;					// instructor name/credentials, appears on class registration page
	this.subject = subject;				// general subject area (e.g botany, entomology, etc), sort key on list pages, appears on list pages
	this.page = page;					// hyperlink to reservation page
	this.cost = cost;					// cost details, format:  <cost element title>:<unit cost text>:<extended cost formula pattern>   Example "Tuition:$175.00:(qty*175)"
}

// Retrieve a specified database object
function fetchDBobj(theKey) {
	var i;
	var theIndex = -1;
	for (i=0; i<SJNI_DBobj.length; i++) {
		if (SJNI_DBobj[i].key==theKey) {
			theIndex=i;
			break;
		}
	}
	if (theIndex<0) return null;
	return SJNI_DBobj[theIndex];		
}

//	SJNI Class Calendar  ---  IMPORTANT: Classes must be in date-sequence (chronological order) within age group
//	Args: unique key, DB entry type, age group, class title, mm/dd/yy[-mm/dd/yy], date text, time text, cost text, island, instructor, general subject area, link to detail page, cost details
//
//SJNI_DBobj[xx] = new SJNI_DBentry('key','type','age','title','mmddyy','datestr','timestr','coststr','loc','island','instructor','subject','link','cost detail');
//
//	Notes:	Unique key may not contain single quote.
//			DB entry types:	C=Adult Workshop, Y=Young Naturalist Program, S=Sale item,
//
//			Cost: entry is a string of triplets, delimited by | each consisting of a cost item title, it's unit cost text, and 
//			a formula pattern used to compute extended cost. Each element of the triplet is delimited by a colon (:).
//			Example: Tuition:$175.00:(qty*175)|Ferry:$15.00:(qty*15) = this is two elements to the workshop cost, one for tuition and one for meals.
//
//			Extended cost formula pattern: a string expression that when evaluated by javascript results in a valid numeric solution.
//			The pattern may use the following reserved words to represent variables, which are substituted during evaluation:
//			qty = the quantity from the order (this is actually arg0)
//			argN (where n is numeric) represents the nth argument within the cart cost arguments string	(note: format for cart entry is  db-key:options:qty,arg1,arg2,... )
//
//	*** Adult classes/workshops
SJNI_DBobj[0]  = new SJNI_DBentry('bot0417','C','all','Lichens on Lopez',					'4/17/10','Saturday, April 17, 2010',	'10:30am - 4:30pm',	'$40',	'Lopez High School - Science Lab',								'Lopez',	'Dr. Fred Rhoades, WWU',	'Botany',	'classdir/generic.php?dbkey=bot0417&incl=d',	'Tuition:$40.00:(qty*40)');
SJNI_DBobj[1]  = new SJNI_DBentry('geo0502','C','all','<span style="text-decoration:line-through">Geology of Sucia</span> FILLED',				'5/02/10','Sunday, May 2, 2010',		'9:30am - 3:30pm',	'$45',	"Enzo's Coffee Bar",											'Orcas',	'Michael Yeaman',			'Geology',	'classdir/geo0502.php?dbkey=geo0502&incl=d',	'Tuition:$45.00:(qty*45)');
SJNI_DBobj[2]  = new SJNI_DBentry('bot0508','C','all','Ethnobotany and Edibles',			'5/08/10','Saturday, May 8, 2010',		'11:30am - 4:00pm',	'$40',	'Meet at Churchill House, San Juan Preservation Trust Offices',	'San Juan',	'MacClellan (Mac) Smith',	'Botany',	'classdir/generic.php?dbkey=bot0508&incl=d',	'Tuition:$40.00:(qty*40)');
SJNI_DBobj[3]  = new SJNI_DBentry('geo0508','C','all','Geology of Sucia',					'5/08/10','Saturday, May 8, 2010',		'9:30am - 3:30pm',	'$45',	"Enzo's Coffee Bar",											'Orcas',	'Michael Yeaman',			'Geology',	'classdir/generic.php?dbkey=geo0508&incl=d',	'Tuition:$45.00:(qty*45)');
SJNI_DBobj[4]  = new SJNI_DBentry('bio0620','C','all','Biodiversity of Watmough Bay',		'6/20/10','Sunday, June 20, 2010',		'10:30am - 4:00pm',	'$40',	'Land Bank Preserve - Watmough Bay',							'Lopez',	'Russel Barsh, Kwaiht',		'Biology',	'classdir/generic.php?dbkey=bio0620&incl=d',	'Tuition:$40.00:(qty*40)');
//
//	SJNI Young Naturalists Calendar, organize by age group, then date
//
//	*** Preschool  ages 4-5
SJNI_DBobj[5]  = new SJNI_DBentry('yn00705','Y','0-5','Pond Life',							'7/5/10','Monday July 5, 2010',			'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00705&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[6]  = new SJNI_DBentry('yn00712','Y','0-5','Animal Senses',						'7/12/10','Monday July 12, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00712&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[7]  = new SJNI_DBentry('yn00714','Y','0-5','Family Rocky Shore Adventure',		'7/14/10','Wednesday July 14, 2010',	'11:00am - 2:00pm',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00714&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[8]  = new SJNI_DBentry('yn00719','Y','0-5','Nature&prime;s Patterns',			'7/19/10','Monday July 19, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00719&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[9]  = new SJNI_DBentry('yn00726','Y','0-5','Walking Like a Wild Thing',			'7/26/10','Monday July 26, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00726&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[10] = new SJNI_DBentry('yn00802','Y','0-5','Animal Babies',						'8/02/10','Monday August 2, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00802&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[11] = new SJNI_DBentry('yn00809','Y','0-5','My Home is a Nest',					'8/09/10','Monday August 9, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00809&incl=d','Tuition:$20:(qty*20)');
SJNI_DBobj[12] = new SJNI_DBentry('yn00816','Y','0-5','What&Prime;s For Lunch?',			'8/16/10','Monday August 16, 2010',		'9:00am - 11:00am',		'$20 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn00816&incl=d','Tuition:$20:(qty*20)');

//  *** Ages 5-7
SJNI_DBobj[13] = new SJNI_DBentry('yn50629','Y','5-7','Rocky Shore Explorers',				'6/29/10','Tuesday June 29, 2010',		'11:00am - 2:00pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50629&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[14] = new SJNI_DBentry('yn50630','Y','5-7','Rocky Shore Explorers',				'6/30/10','Wednesday June 30, 2010',	'11:30am - 2:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50630&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[15] = new SJNI_DBentry('yn50713','Y','5-7','Family Rocky Shore Explorers',		'7/13/10','Tuesday July 13, 2010',		'10:30am - 1:30pm',		'$25 per child, per class (includes parent)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50713&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[16] = new SJNI_DBentry('yn50720a','Y','5-7','Nature Crafts',						'7/20/10','Tuesday July 20, 2010',		'9:30am - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50720a&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[17] = new SJNI_DBentry('yn50720b','Y','5-7','Nature Crafts',						'7/20/10','Tuesday July 20, 2010',		'1:00pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50720b&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[18] = new SJNI_DBentry('yn50721','Y','5-7','Habitat Explorer',					'7/21/10','Wednesday July 21, 2010',	'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50721&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[19] = new SJNI_DBentry('yn50727','Y','5-7','Nature Detective',					'7/27/10','Tuesday July 27, 2010',		'9:30pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50727&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[20] = new SJNI_DBentry('yn50728','Y','5-7','Underwater Web of Life',				'7/28/10','Wednesday July 28, 2010',	'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50728&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[21] = new SJNI_DBentry('yn50803','Y','5-7','Search for Nature&prime;s Treasures','8/03/10','Tuesday August 3, 2010',		'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50803&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[22] = new SJNI_DBentry('yn50804','Y','5-7','Watch Your Back! Predators and Prey','8/04/10','Wednesday August 4, 2010',	'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50804&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[23] = new SJNI_DBentry('yn50810','Y','5-7','A Feathery Life',					'8/10/10','Tuesday August 10, 2010',	'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50810&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[24] = new SJNI_DBentry('yn50811a','Y','5-7','Building With a Beak',				'8/11/10','Wednesday August 11, 2010',	'9:30pm - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50811a&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[25] = new SJNI_DBentry('yn50811b','Y','5-7','Six-Legged Wonders',				'8/11/10','Wednesday August 11, 2010',	'1:00pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn50811b&incl=d','Tuition:$25:(qty*25)');

//	*** Ages 8-12
SJNI_DBobj[26] = new SJNI_DBentry('yn80701','Y','8-12','Rocky Shore Explorers',				'7/01/10','Thursday July 1, 2010',		'Noon - 3:00pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn80701&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[27] = new SJNI_DBentry('yn8070608','Y','8-12','Natural Science Camp',			'7/06/10 - 7/08/10','Tue-Thur July 6-8, 2010','8:30am - Noon',	'$25 per child, per class ($75 for all 3 days)','Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn8070608&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[28] = new SJNI_DBentry('yn80803','Y','8-12','Nature Treasure Hunt',				'8/03/10','Tuesday August 3, 2010',		'1:00pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn80803&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[29] = new SJNI_DBentry('yn80804','Y','8-12','Watch Your Back! Predators and Prey','8/04/10','Wednesday August 4, 2010',	'1:00pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn80804&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[30] = new SJNI_DBentry('yn80810','Y','8-12','Migration Headaches',				'8/10/10','Tuesday August 10, 2010',	'1:00pm - 3:30pm',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn80810&incl=d','Tuition:$25:(qty*25)');
SJNI_DBobj[31] = new SJNI_DBentry('yn80812','Y','8-12','Good, Bad and Ugly Bugs',			'8/12/10','Thursday August 12, 2010',	'9:30am - Noon',		'$25 per child, per class',						'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Alice Hibberd',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=yn80812&incl=d','Tuition:$25:(qty*25)');

//	*** special day-camp classes w/ Leisha Holmes
SJNI_DBobj[32] = new SJNI_DBentry('dc5070815','Y','daycamp','Hands On Nature (ages 5-7)',	'7/08/10 &amp; 7/15/10','Thursdays July 8&nbsp;&amp;&nbsp;15, 2010',	'9:30am - Noon',	'$45 per child (includes both days)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Leisha Holmes',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=dc5070815&incl=d','Tuition:$45:(qty*45)');
SJNI_DBobj[33] = new SJNI_DBentry('dc8082325','Y','daycamp','Science in Nature (ages 8-12)','8/23/10 &amp; 8/25/10','Mon, Wed August 23&nbsp;&amp;&nbsp;25, 2010',	'9:30am - Noon',	'$45 per child (includes both days)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Leisha Holmes',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=dc8082325&incl=d','Tuition:$45:(qty*45)');
SJNI_DBobj[34] = new SJNI_DBentry('dc5082426','Y','daycamp','Scrimshaw (ages 5-8)',			'8/24/10 &amp; 8/26/10','Tue, Thur August 24&nbsp;&amp;&nbsp;26, 2010',	'9:30am - Noon',	'$45 per child (includes both days)',	'Registered students will receive notification of the venue prior to the class<br><br>',	'San Juan',		'Leisha Holmes',	'Young Naturalists',	'classdir/genericyn3.php?dbkey=dc5082426&incl=d','Tuition:$45:(qty*45)');

//	SJNI Sale Items
//	Args: unique key, DB entry type, age group, item description, mm/dd/yy[-mm/dd/yy], date text, time text, cost text, venue, island, instructor, general subject area, link to detail page, cost details
//
SJNI_DBobj[35] = new SJNI_DBentry('printSPCA','S','','Serigraph Print: Salmon People-Chiin Xaada','','','','','','','','Artwork','','Serigraph:$150.00:(qty*150)|Shipping:$20.00:(20)');
SJNI_DBobj[36] = new SJNI_DBentry('dinner1010','X','all','Celebrate Stewardship','10/10/09','Saturday, October 10, 2009','6:00pm','$45','To Be Announced','San Juan','','Event','','Reservation:$45.00:(qty*45)');
SJNI_DBobj[37] = new SJNI_DBentry('supper0912','S','all','Save Our Salmon Program - Picnic','9/12/10','Sunday, September 12, 2010','3:00pm - 5:30pm','$30-$50-$60','Jim and Kathy Youngren Residence, Orcas Island','Orcas','','Event','','Individual:$30.00:(qty*30)|Couple:$50.00:(qty*50)|Family:$60.00:(qty*60)');

// ******************************************************************************************************************************
