
function actimg(img) {
	src = img.src;
	p = src.lastIndexOf('_');
	if (src.substr(p+1, 3)=='off') img.src = src.substring(0, p)+'_on.gif';
}

function deactimg(img) {
	src = img.src;
	p = src.lastIndexOf('_');
	if (src.substr(p+1, 2)=='on') img.src = src.substring(0, p)+'_off.gif';
}

function actmodimg(imgname) {
	if (document.images && document.images[imgname]) {
		src = document.images[imgname].src;
		p = src.lastIndexOf('.');
		document.images[imgname].src = src.substring(0, p)+'_a.gif';
	}
}

function deactmodimg(imgname) {
	if (document.images && document.images[imgname]) {
		src = document.images[imgname].src;
		p = src.lastIndexOf('_');
		document.images[imgname].src = src.substring(0, p)+'.gif';
	}
}

function updateImg(imgname, newsrc) {
	if (document.images && document.images[imgname]) {
		document.images[imgname].src = newsrc;
	}
}


/*
	Klasse ImageToggler (für automatisierte Dia-Show)
*/

function ImageToggler_addImage(url) {
	this.imageList[this.imageList.length] = url;
}

function ImageToggler_run() {
	if (this.imageList.length>0) {
		if (document.all) document.images[this.imageName].filters.blendTrans.Apply();
		document.images[this.imageName].src = this.imageList[this.nextImage];
		if (document.all) document.images[this.imageName].filters.blendTrans.Play();
		
		this.nextImage++;
		if (this.nextImage>=this.imageList.length) this.nextImage = 0;
	}
	window.setTimeout(this.variableName +'.run();', this.duration);
}

function ImageToggler(varname, imagename) {
	this.variableName = varname;
	this.imageName = imagename;
	this.imageList = new Array();
	this.nextImage = 0;
	this.duration = 5000;
	
	this.addImage = ImageToggler_addImage;
	this.run = ImageToggler_run;
	this.run();
}

