
$(function() {
   $('a[rel*=lightbox]').lightBox({
	overlayBgColor: '#000',
	overlayOpacity: 0.7,
	imageLoading: '/img/sb/loading.gif',
	imageBtnClose: '/img/sb/closelabel.gif',
	imageBtnPrev: '/img/sb/prevlabel.gif',
	imageBtnNext: '/img/sb/nextlabel.gif',
	containerResizeSpeed: 900,
	txtImage: 'Bild',
	txtOf: 'von'
   });
});


function toggleaddress(element) {
	
	dasdiv = $(element).parent("address").children("span");
	dasdiv.toggle("slow");
	
}

function togglespan(element) {
	
	dasdiv = $(element).parent("li").children("span");
	dasdiv.toggle("slow");
	
}

function showlayer(what) {
	//if (document.getElementById) document.getElementById("project00").style.display = "none";
	if (document.getElementById) document.getElementById(what).style.display = "block";
}


function hidelayer(what) {
	if (document.getElementById) document.getElementById(what).style.display = "none";
}



function showinfobox(evt,object) {
	
	
	// ------ positioning of infolyer to mouseover-a -------
	var xposition = 500;
	var yposition = 500;  
	  
	if (document.getElementById) {
    	xposition  = evt.clientX;
		yposition = evt.clientY;
	}
  
	if (document.all) {
		scrollposition = document.documentElement.scrollTop ;
	}
	else {
		scrollposition = window.pageYOffset
	}
	
	document.getElementById("infolayer").style.left = xposition + 20 + "px";
	document.getElementById("infolayer").style.top = yposition + scrollposition - 15 + "px";
	
	// -------- get infos an write new infolayer ----------
	
	var atext = object.innerHTML;
	/*
	infostring = "<div>" + atext.replace(/<dfn>/i,'</div><p>');
	infostring = infostring.replace(/<\/dfn>/i,'</p>');
	infostring = infostring.replace('(','');
	infostring = infostring.replace(')','');
	*/
	infostring = "<div><p>" + atext.replace(/<dfn>/i,'</p></div>');
	
	document.getElementById("infolayer").innerHTML = infostring;

	// -------- show infolayer ----------
  
	document.getElementById("infolayer").style.visibility = "visible";
	
	return false;
}

function hideinfobox() {
	document.getElementById("infolayer").style.visibility = "hidden";
}
