rendered paste bodyfunction selectgroup(id){ this.thumbs = document.getElementById(id); this.images = this.thumbs.getElementsByTagName('img'); this.Select = function (pictureid) { alert(pictureid); if(document.getElementById(pictureid).className == 'selected'){; document.getElementById(pictureid).className = 'unselected' } else document.getElementById(pictureid).className = 'selected' } this.SelectAll = function (){ for(i = this.images.length-1; i>=0; i--) this.images[i].className = 'selected'; } this.UnSelectAll = function () { for(i = this.images.length-1; i>=0; i--) this.images[i].className = 'unselected'; } this.InvertSelection = function () { for(i = this.images.length-1; i>=0; i--) if(this.images[i].className == 'selected') this.images[i].className = 'unselected'; else this.images[i].className = 'selected'; } this.MoveSelectedToDiv = function (divID) { for(i = this.images.length-1; i>=0; i--){ if(this.images[i].className == 'selected'){ this.images[i].className = 'unselected' // stygg fiks //this.images[i].setAttribute('style', 'margin:2px'); document.getElementById(divID).appendChild(this.images[i]); } } } for(i = this.images.length-1; i>=0; i--){ var action = function () { this.Select(this.images[i].id) } this.images[i].onclick = action; }}unbatched = new selectgroup('thumbs')