var loadImage = dojo.hitch(this, function(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", this, 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", this, 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(); 
dojo.connect(img, "onclick", this, 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; 
		var loadImage = dojo.hitch(this, function(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];			var sl = this.thumbScroller.scrollLeft, st = this.thumbScroller.scrollTop;			dojo.style(this.thumbsNode, this._sizeProperty, (size + defaultSize + 20) + "px");			//Remember the scroll values, as changing the size can alter them			this.thumbScroller.scrollLeft = sl;			this.thumbScroller.scrollTop = st;			this.thumbsNode.appendChild(imgContainer);					dojo.connect(img, "onload", this, 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", this, 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();		});
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/75f2030aef51379b6ac902f159c22a4b917d93e2/ThumbnailPicker.js/buggy/image/ThumbnailPicker.js