+Lightbox.prototype.deleteSelection = function() {
+ var i, e, slide;
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ slide = e.parentNode.parentNode;
+ slide.classList.add('zero_width');
+ }
+ }
+ var self = this;
+ // if you change this, delay you should also change this css rule :
+ // .lightbox span { transition: width 1s
+ setTimeout(function(){self._removeSelection();}, 1000);
+};
+
+Lightbox.prototype._removeSelection = function() {
+ var i, e, slide;
+ var toRemove = [];
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ toRemove.push(e.parentNode.parentNode);
+ }
+ }
+ for (i=0 ; i<toRemove.length ; i++) {
+ slide = toRemove[i];
+ slide.parentNode.removeChild(slide);
+ }
+ this.cbIndex = undefined;
+};
+
+Lightbox.prototype.getCBIndex = function(cb) {
+ if (!this.cbIndex) {
+ // build checkbox index
+ this.cbIndex = [];
+ var i, node, c;
+ var nodes = this.grid.childNodes;
+ for (i=0 ; i<nodes.length ; i++) {
+ node = nodes[i];
+ if (node.nodeName === 'SPAN') {
+ c = node.getElementsByTagName('input')[0];
+ c.index = this.cbIndex.length;
+ this.cbIndex[this.cbIndex.length] = c;
+ }
+ }
+ }
+ return cb.index;
+};
+
+Lightbox.prototype.selectCBRange = function(evt) {