/**
 *    Copyright (c) 2009-2010, As Is Software, dba Media Lab Inc.
 *    http://www.medialab.com
 */

/*
 * 	Notes:
 * 	This thumbsheet doesn't do anything but allow the user to add a hidden view
 *  for the purpose of giving certain applicable pictureboxes (like before/after) 
 *  access to them.
 */

var com;
if(!com) { com = {}; } else if(typeof(com) != "object") { throw new Error("can't initialize...com is not an object."); }
if(!com.medialab) { com.medialab = {}; } else if(typeof(com.medialab) != "object") { throw new Error("can't initialize...com.medialab is not an object."); }
if(!com.medialab.sg) { com.medialab.sg = {}; }
if (!com.medialab.sg.gallery1) { com.medialab.sg.gallery1 = {};}


com.medialab.sg.gallery1.thumbsheetHidden =
function (thumbSheetXMLIn, modeIn, docentIn) { 
	var that=this;
	var debug = false;
	var sgalert = function(msg) { if (debug) {
		alert(msg);
	} };
	var docent= docentIn;

	//alert(docentIn);
	var xml = thumbSheetXMLIn;
    var cssInitialized=false;
	var thumbWidth = 0;
	var thumbHeight = 0;
	var sheetWidth = 0;
	var sheetHeight = 0;
	var sheetMode = modeIn;
	var sheetDivID = "not set yet";
	var thumbDivID = "not set yet";
	var linkClass = "not set yet";
	var changeimageonhover = "false";
	
	this.select = function (thumbnum) {
		// called whenever a new image is selected to sync
		// could be called becuase a thumb (including this one) is clicked
		// or for any other reason the docent wants, like next/prev buttons.
		
		// don't do anything if already synced 
		
		
		// If not synced then hilite apropriate thumb if necessary
		// and dehilite others if necessary
		docent.sgconsole("thumbsheet select called");
//		initSheet();
		
		
	}
	
	function getAThumb(thumbnum, bkgdURL) {
		var tdiv = "";
		
		// Thumb div
		return tdiv;
	}
	
	
	function init() {
		sgalert("Hidden Thumbsheet: Init", this);
	}
	
	 function processXML () {
		return;
	}
		
	this.updateSheet = function() {
		//initSheet();
	}
	
	this.getAThumbIterator = function(n,data,url){
		//data.containerText += getAThumb(n,url);
	}

// New version of initsheet using docent iterator

	function initSheet () { 
	}

	
	function getOption(opt) {
		var w = docent.getThumbSheetOption(sheetMode,opt);
		return w;
	}
				
	init();
}
