
/* Copyright (c) 2006 Photography by Michael K. Johnson. All rights reserved. */

/**
 *  MKJPhoto Gallery Finder
 *
 *  Version: 1.0.0a (20060612) "Primero"
 *  Author:  Andrew Murphy <andrew@booleangate.org>
 *
 *  The following scripting is copyright 2006 Photography by Michael K. Johnson
 *  and Booleangate, Inc. unless stated otherwise.
 */
 
 /**
  *  Note: This API is provided as is, and without complete documentation.
  *  Please do not contact the author regarding implementation support.
  */


include(
	[
		"json/json.js",
		"prototype/prototype.js",
		"debug.js"
	],
	SCRIPT_BIN
);

include(
	[
		"breadcrumbs.js?area=publicpath=",
		"icons.js?area=publicpath=",
		"finder.js?area=publicpath=",
		"services.js?area=publicpath="
	],
	SCRIPT_BIN+"gallery/finder/"
);




var finder = {
	"path"    : "",       //string: finders current path
	"data"    : [],       //array: container
	"area"    : "public", //string: public or private
	"baseUrl" : "",       //string: base url for paths
	"temp"    : "",       //string: temporary storage of paths during async queries
	"current" : [],       //array: current nodes
	
	"url" : {
		"services" : "http://www.mkjphoto.com/services/"
	},
	
	"query" : {
		"eventListing" : "action=galleryEventListing&area=%AREA%",
		"eventDetails" : "action=galleryEventDetails&area=%AREA%&year=%YEAR%&category=%CATEGORY%&event=%EVENT%"
	},

	"status" : {
		"galleryNormal"  : 0,
		"galleryClosed"  : 1,
		"galleryExpired" : 2,
		"galleryPending" : 3
	},

	"id" : {
		"breadcrumbs"    : "finder-breadcrumbs" ,
		"icons"          : "finder-container"   ,
		"galleryOpen"    : "open"               ,
		"galleryClosed"  : "closed"             ,
		"galleryPending" : "pending"            ,
		"galleryExpired" : "expired"            ,
		"galleryGallery" : "gallery"
	},

	"template" : {
		"breadcrumb"          : "<a href=\"%BASEURL%/%URL%\" onClick=\"finder.goto('%URL%'); return false;\">%TITLE%</a>",
		"breadcrumbSeperator" : " &#187; ",
		"icon"                : "<a href=\"%BASEURL%/%URL%\" onClick=\"finder.goto('%URL%'); return false;\" class=\"%CLASS%\" title=\"%TITLE%\">%TITLE%</a>",
		"galleryIcon"         : "<a href=\"%BASEURL%/%URL%\" class=\"%CLASS%\" title=\"%TITLE%\">%TITLE%</a>"
	},

	"breadcrumbs" : {
		"crumbs"   : [] , //array: breadcrumb node storage
		"crumb"    : {
			"build"     : function(){}, //function: (object) create breadcrumb from node
			"stringify" : function(){} //function: (object) create icon string
		},
		"store"    : function(){}, //function: place a breadcrumb node in the crumbs array
		"populate" : function(){}, //function: populate the breadcrumbs container
		"reset"    : function(){},  //function reset the breadcrumbs
		"getClass" : function(){}
	},

	"icons" : {
		"icons"    : [] , //array: icon node storage
		"icon"     : {
			"build"     : function(){}, //function: (object) create an icon object
			"stringify" : function(){}  //function: (string) create an icon string
		},
		"store"    : function(){}, //function: place an icon node in the icons array
		"populate" : function(){}, //function: populate an icon container
		"reset"    : function(){}  //function: reset the icons
	},

	"services" : {
		"handle"         : {
			"eventListing" : function(){},
			"eventDetails" : function(){}
		},
		"query"          : {
			"eventListing" : function(){},
			"eventDetails" : function(){}
		},
		"encodeParams"   : function(){},
		"encodeCleanurl" : function(){},
		"decodeCleanurl" : function(){}
	},

	"working" : function(){}, //function: show that the finder is working in the background
	"goto"    : function(){}, //function: load a gallery path into the finder
	"init"    : function(){}  //function: initialize the finder
};


load_on_startup("finder.init(finder_starting_path, finder_area, finder_baseurl);");


