kontakt_n=new Image(); kontakt_n.src = "fileadmin/images/kontakt_n.gif"; 
kontakt_h=new Image(); kontakt_h.src = "fileadmin/images/kontakt_h.gif"; 


// A script by: Michael van Ouwerkerk (netfielders websolutions)
// February 9 2002

if (!Array.prototype.push) {
	Array.prototype.push = function() {
		for (var i = 0; i < arguments.length; i ++) this[this.length] = arguments[i];
		return this.length;
	}
}


if (!Array.prototype.pop) {
	Array.prototype.pop = function() {
		var lastitem = this.length > 0 ? this[this.length - 1] : undefined;
		if (this.length > 0) this.length --;
		return lastitem;
	}
}


function findImg(id, d) {
	var img = null;
	if (!d) d = document;
	if (d.images) img = d.images[id];
	else if (d.getElementById) img = d.getElementById(id);
	for (var i=0; !img && d.layers && i<d.layers.length; i++){
		img = findImg(id, d.layers[i].document);
	}
	return img;
}


var Img = {
	
	preloader : new Array(),
	stack : new Array(),
	
	//=====================================================================
	// The Img.swap arguments are pairs of id and src strings.
	// There can be as many pairs in a call to rollover as you want.
	// Example of use: Img.swap('imgMinimalsm', 'images/minimalsm_on.gif')
	//=====================================================================
	
	swap : function() {
		var img = null;
		var src = null;
		var i = arguments.length - 1;
		
		while (i >= 0) {
			img = findImg(arguments[i-1]);
			src = arguments[i];
			if (!img || !src) return;
			
			this.stack.push(img);
			this.stack.push(img.src);
			img.src = src;
			i -= 2;
		}
	},
	
	//================================================================
	// Img.restore sets all the images back to their original source.
	// It also clears the Img.stack array.
	// Example of use: Img.restore()
	//================================================================
	
	restore : function() {
		var i = this.stack.length - 1;
		
		while (i >= 0) {
			this.stack[i-1].src = this.stack[i];
			this.stack.pop();
			this.stack.pop();
			i -= 2;
		}
	},
	
	//=====================================================================================
	// Img.preload - preloads images.
	// Arguments are as many source strings as you want.
	// Example of use: Img.preload('images/minimalsm_on.gif', 'images/suprematism_on.gif')
	//=====================================================================================

	preload : function() {
		var args = arguments.length;
		for (var i = 0; i < args; i++) {
			this.preloader.push(new Image());
			this.preloader[this.preloader.length-1].src = arguments[i];
		}
	}
}

// end
