function loadImage(data, index, callback) { var url = _this.imageStore.getValue(data,_this.imageThumbAttr); var img = document.createElement("img"); var imgContainer = document.createElement("div"); imgContainer.setAttribute("id","img_" + _this.widgetid+"_"+index); imgContainer.appendChild(img); img._index = index; img._data = data;  _this._thumbs[index] = imgContainer; var loadingDiv; if(_this.useLoadNotifier){ loadingDiv = document.createElement("div"); loadingDiv.innerHTML = "<!-- -->"; loadingDiv.setAttribute("id","loadingDiv_" + _this.widgetid+"_"+index);    _this._setThumbClass(loadingDiv, _this._loadedImages[index] ? "thumbLoaded":"thumbNotifier");  imgContainer.appendChild(loadingDiv); } var size = dojo.marginBox(_this.thumbsNode); var defaultSize; var sizeParam; if(_this.isHorizontal){ defaultSize = _this.thumbWidth; sizeParam = 'w'; } else{ defaultSize = _this.thumbHeight; sizeParam = 'h'; } size = size[sizeParam]; dojo.style(_this.thumbsNode, _this._sizeProperty, (size + defaultSize + 20) + "px"); console.log("Increased the size from " + size + " to " + (size + defaultSize + 20) +" because defaultSize = " + defaultSize); _this.thumbsNode.appendChild(imgContainer);  dojo.connect(img, "onload", function(){ var realSize = dojo.marginBox(img)[sizeParam];  _this._totalSize += (Number(realSize) + 4);  dojo.style(_this.thumbsNode, _this._sizeProperty, _this._totalSize + "px"); console.log("IMG size = " + realSize + ": Changed the size from " + size + " to " + _this._totalSize);  if(_this.useLoadNotifier){dojo.style(loadingDiv, "width", (img.width - 4) + "px"); } callback(); return false; });  dojo.connect(img, "onclick", function(evt){ console.log("Publishing pos " + evt.target._index); dojo.publish(_this.getClickTopicName(),	[{ index: evt.target._index, data: evt.target._data, url: img.getAttribute("src"), largeUrl: _this.imageStore.getValue(data,_this.imageLargeAttr), title: _this.imageStore.getValue(data,_this.titleAttr), link: _this.imageStore.getValue(data,_this.linkAttr) }]); return false; }); dojo.addClass(img, "imageGalleryThumb"); img.setAttribute("src", url); var title = _this.imageStore.getValue(data, _this.titleAttr); if(title){ img.setAttribute("title",title); } _this._updateNavControls(); } 
function loadImage(data, index, callback) { var url = _this.imageStore.getValue(data,_this.imageThumbAttr); var img = document.createElement("img"); var imgContainer = document.createElement("div"); imgContainer.setAttribute("id","img_" + _this.widgetid+"_"+index); imgContainer.appendChild(img); img._index = index; img._data = data;  _this._thumbs[index] = imgContainer; var loadingDiv; if(_this.useLoadNotifier){ loadingDiv = document.createElement("div"); loadingDiv.innerHTML = "<!-- -->"; loadingDiv.setAttribute("id","loadingDiv_" + _this.widgetid+"_"+index);    _this._setThumbClass(loadingDiv, _this._loadedImages[index] ? "thumbLoaded":"thumbNotifier");  imgContainer.appendChild(loadingDiv); } var size = dojo.marginBox(_this.thumbsNode); var defaultSize; var sizeParam; if(_this.isHorizontal){ defaultSize = _this.thumbWidth; sizeParam = 'w'; } else{ defaultSize = _this.thumbHeight; sizeParam = 'h'; } size = size[sizeParam]; var sl = _this.thumbScroller.scrollLeft, st = _this.thumbScroller.scrollTop; dojo.style(_this.thumbsNode, _this._sizeProperty, (size + defaultSize + 20) + "px");  _this.thumbScroller.scrollLeft = sl; _this.thumbScroller.scrollTop = st; _this.thumbsNode.appendChild(imgContainer);  dojo.connect(img, "onload", function(){ var realSize = dojo.marginBox(img)[sizeParam]; _this._totalSize += (Number(realSize) + 4); dojo.style(_this.thumbsNode, _this._sizeProperty, _this._totalSize + "px");  if(_this.useLoadNotifier){dojo.style(loadingDiv, "width", (img.width - 4) + "px"); } callback(); return false; });  dojo.connect(img, "onclick", function(evt){ dojo.publish(_this.getClickTopicName(),	[{ index: evt.target._index, data: evt.target._data, url: img.getAttribute("src"), largeUrl: _this.imageStore.getValue(data,_this.imageLargeAttr), title: _this.imageStore.getValue(data,_this.titleAttr), link: _this.imageStore.getValue(data,_this.linkAttr) }]); return false; }); dojo.addClass(img, "imageGalleryThumb"); img.setAttribute("src", url); var title = _this.imageStore.getValue(data, _this.titleAttr); if(title){ img.setAttribute("title",title); } _this._updateNavControls(); } 
    function loadImage(data, index, callback) {            var url = _this.imageStore.getValue(data,_this.imageThumbAttr);        var img = document.createElement("img");        var imgContainer = document.createElement("div");        imgContainer.setAttribute("id","img_" + _this.widgetid+"_"+index);        imgContainer.appendChild(img);        img._index = index;        img._data = data;            _this._thumbs[index] = imgContainer;        var loadingDiv;        if(_this.useLoadNotifier){          loadingDiv = document.createElement("div");          loadingDiv.innerHTML = "<!-- -->";          loadingDiv.setAttribute("id","loadingDiv_" + _this.widgetid+"_"+index);                    //If this widget was previously told that the main image for this          //thumb has been loaded, make the loading indicator transparent.          _this._setThumbClass(loadingDiv,                _this._loadedImages[index] ? "thumbLoaded":"thumbNotifier");              imgContainer.appendChild(loadingDiv);        }        var size = dojo.marginBox(_this.thumbsNode);        var defaultSize;        var sizeParam;        if(_this.isHorizontal){          defaultSize = _this.thumbWidth;          sizeParam = 'w';        } else{          defaultSize = _this.thumbHeight;          sizeParam = 'h';        }        size = size[sizeParam];        dojo.style(_this.thumbsNode, _this._sizeProperty, (size + defaultSize + 20) + "px");        console.log("Increased the size from " + size + " to " + (size + defaultSize + 20) +" because defaultSize = " + defaultSize);        _this.thumbsNode.appendChild(imgContainer);            dojo.connect(img, "onload", function(){          var realSize = dojo.marginBox(img)[sizeParam];                    _this._totalSize += (Number(realSize) + 4);              dojo.style(_this.thumbsNode, _this._sizeProperty, _this._totalSize + "px");          console.log("IMG size = " + realSize + ": Changed the size from " + size + " to " + _this._totalSize);              if(_this.useLoadNotifier){dojo.style(loadingDiv, "width", (img.width - 4) + "px"); }          callback();          return false;        });            dojo.connect(img, "onclick", function(evt){            console.log("Publishing pos " + evt.target._index);            dojo.publish(_this.getClickTopicName(),	[{                index: evt.target._index,                data: evt.target._data,                url: img.getAttribute("src"),                 largeUrl: _this.imageStore.getValue(data,_this.imageLargeAttr),                title: _this.imageStore.getValue(data,_this.titleAttr),                link: _this.imageStore.getValue(data,_this.linkAttr)          }]);          return false;        });        dojo.addClass(img, "imageGalleryThumb");        img.setAttribute("src", url);        var title = _this.imageStore.getValue(data, _this.titleAttr);        if(title){ img.setAttribute("title",title); }        _this._updateNavControls();    }
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/fd0905f7d5e660c20fd78d43589db96a2c5f07bd/ThumbnailPicker.js/buggy/image/ThumbnailPicker.js