dojo.provide("dojSSS.Lightbox"); 

dojo.experimental("dojSSS.Lightbox"); 
dojo.require("dojo.window"); 
dojo.require("dijit.Dialog"); 
dojo.require("dojox.fx._base"); 

dojo.declare("dojSSS.Lightbox",dojox.image.Lightbox, {
	show: function(){

		if (dojo.byId('theFooter')) {
			dojo.byId('theFooter').style.visibility = 'hidden';
			dojo.byId('theFooter').style.display = 'block';
		}

		// summary: Show the Lightbox with this instance as the starting point
		this._attachedDialog.show(this);
	},
	startup: function(){
		this.inherited(arguments);
		// setup an attachment to the masterDialog (or create the masterDialog)

		// this is the first instance to start, so we make the masterDialog
//		this._attachedDialog = new dojSSS.LightboxDialog({ id: "dojoxLightboxDialogSSS" });
		this._attachedDialog = new dojSSS.LightboxDialog();

		this._attachedDialog.startup();

		if(!this.store){
			// FIXME: full store support lacking, have to manually call this._attachedDialog.addImage(imgage,group) as it stands
			this._addSelf();
			this.connect(this.domNode, "onclick", "_handleClick");
		}

	}
//	

});

dojo.declare("dojSSS.LightboxDialog", dojox.image.LightboxDialog, { 

	hide: function(){
		
		dojo.hitch(this, function(){this.imgNode.src = this._blankGif});
		// summary: Hide the Master Lightbox
//		dojo.fadeOut({
//			node: this.titleNode, 
//			duration: 200,
//			// #5112 - if you _don't_ change the .src, safari will 
//			// _never_ fire onload for this image
//			onEnd: dojo.hitch(this, function(){
//				this.imgNode.src = this._blankGif;
//			})
//		}).play(5);

                if (dojo.byId('theFooter')) {
                        dojo.byId('theFooter').style.visibility = 'visible';
                        dojo.byId('theFooter').style.display = 'block';
                }

		this.inherited(arguments);

		this.inGroup = null;
		this._index = null;
	}

}); 


