All pastes #98829 Raw Edit

Unnamed

public javascript v1 · immutable
#98829 ·published 2006-07-24 20:52 UTC
rendered paste body
function 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')