var galleries_array = new Array();var currentGallery_obj; var currentItem_num;var _preloaded = false;var images_array = new Array();var bg_col = '';function Gallery(description,label){	this.description_str = description;	this.label_str = (label!=undefined)? label.split(' ').join('&nbsp;') : '';	this.items_array = new Array();	this.items_num = 0;	this.addItem = function(src,label)	{		var i = new GalleryItem(src,label);		this.items_array.push(i);		this.items_num = this.items_array.length;	}}function GalleryItem(src,label){	this.src = redirect + src;	this.label = (label!=undefined)? label : '';}function nextImage(){	currentItem_num = (currentItem_num+1)%currentGallery_obj.items_num;	updateContact(currentItem_num==0);	showImage(currentGallery_obj.items_array[currentItem_num]);}function prevImage(){	currentItem_num = (currentItem_num-1+currentGallery_obj.items_num)%currentGallery_obj.items_num;	updateContact(currentItem_num==0);	showImage(currentGallery_obj.items_array[currentItem_num]);}function setGallery(nr){		if (nr>-1) currentGallery_obj = galleries_array[nr];	currentItem_num = 0;		// chek if alternative color is defined for gallery pages	if (bg_col.length>0 && nr>-1) 	{		document.bgColor = bg_col;	} else {		document.bgColor = 'white';	}		// setup subnavigation	findObj('pseudoPages').style.display = 'block';	var links = '';	// look for mutliple galleries	if (galleries_array.length>1)	{		for (var i=0; i<galleries_array.length; i++)		{			if (i==nr)			{				links = links + '<li>' + galleries_array[i].label_str + '</li> '			} else {				links = links + '<li><a href="JavaScript:showPseudo(' + i + ');" onfocus=\"blur(this);\">' + galleries_array[i].label_str + '</a></li> '			}		}	}	// look for infoPage	if (findObj('infoPage'))	{		var links = (nr>-1)? links + '<li><a href="JavaScript:showPseudo(-1);" onfocus=\"blur(this);\">INFORMATION</a></li>' : links + '<li>INFORMATION </li>';	}		// check if there are pseudopages for the subnavigation	if (links!='')	{		findObj('pseudoPages').innerHTML = "<ul>" + links + "</ul>";		findObj('pseudoPages').style.marginRight = '10em';	} else {		findObj('imageController').style.display = 'none';	}		// show first picture of selected gallery if available	if (nr>-1 && galleries_array.length>0)	{		showImage(currentGallery_obj.items_array[currentItem_num]);		findObj('imageController').style.display = 'block';	}		// preload images on first call	if (!_preloaded)	{		for (var i=0; i<galleries_array.length; i++)		{			for (var j=0; j<galleries_array[i].items_num; j++)			{				images_array.push(new Image());				images_array[images_array.length-1].src = galleries_array[i].items_array[j].src;			}		}		_preloaded = true;	}}function updateContact(visible_) {	var contact = findObj('contact');	if (contact)	{		if (visible_)		{			contact.style.display = 'block';		} else {			contact.style.display = 'none';		}	}}function showImage(item) {	findObj('imagePlaceholder').style.display = 'none';	findObj('imagePlaceholder').src = item.src;	findObj('imagePlaceholder').onLoad = adjustImageSize(document.getElementById('imagePlaceholder'));	findObj('imageDescription').innerHTML = currentGallery_obj.description_str.split('###optTitel###').join(item.label);	findObj('imageControllerCounter').childNodes[0].nodeValue = addZeros(currentItem_num+1) + ' OF ' + addZeros(currentGallery_obj.items_num);	// document.getElementById('imageControllerCounter').childNodes[0].nodeValue = addZeros(currentItem_num+1) + ' OF ' + addZeros(currentGallery_obj.items_num);}function adjustImageSize(o) {	o.style.display = 'block';}function showPseudo(p){	setGallery(p);	if(p==-1)	{		// InfoPage		findObj('infoPage').style.display = 'block';		findObj('imageGallery').style.display = 'none';		findObj('backLink').style.display = 'block';		findObj('imageController').style.display = 'none';	} else {		// ImageGallery		if(findObj('infoPage')) findObj('infoPage').style.display = 'none';		findObj('imageGallery').style.display = 'block';		findObj('backLink').style.display = 'none';		findObj('imageController').style.display = 'block';	}}function addZeros(s){	s = "00" + s;	return s.substr(-2,2);}// Example: obj = findObj("image1");function findObj(theObj, theDoc){  var p, i, foundObj;    if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)  {    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);    return foundObj;}// JS function for uncrypting spam-protected emails:function mail(_var1, _var2) {    parent.location= "mail" + "to" + ":" + _var2 + "@" + _var1;}