var myRequest = false;var target = false;function lightCB (ajax) {	if (!ajax && $('modalBox')) $('modalBox').remove();	if (!ajax && $('lightBox')) $('lightBox').remove();	if (!ajax) return;	el = new Element('div', {		'id': 'lightBox',		'styles': {			'opacity': 0.8,			'height': (				new Element ('div',{					'id': 'modalBox'/*,					'events': {						'click': function (e) { e.stopPropagation(); }					}*/				}).setHTML(ajax).injectTop($$('body')[0]).getSize().size.y + 80),			'width': window.getScrollWidth() + 'px'		}	}).injectInside($$('body')[0]).setOpacity(0.8);	$('modalBox').getElements('a').addEvent('click', function (e) { e.stopPropagation(); });	if (el.getSize().size.y < window.getScrollHeight())		el.setStyle('height', window.getScrollHeight());	$$('body')[0].setStyle('cursor', 'pointer').addEvent('click', function () {		$$('body')[0].setStyle('cursor', 'default');		window.scrollTo(0, target.getTop() / 2); // Janz nach oben links		lightCB();		$$('body')[0].removeEvents('click');	});	$$('.close').setStyle('cursor', 'pointer').addEvent('mouseup', function (e) {		e.stopPropagation();		$$('.close').setStyle('cursor', 'default');		window.scrollTo(0,  target.getTop() / 2); // Janz nach oben links		lightCB();		$$('body')[0].removeEvents('click');	});	myRequest = false;}function trHover (event) {	if (event.event.currentTarget.tagName == 'A')		el = event.event.currentTarget;	else 		el = event.event.currentTarget.getElements('td');	if (event.type == 'mouseout') 		el.removeClass('underline');	else 		el.addClass('underline');}window.addEvent('domready', function () { $$('tr.galerie', '.impLink').each (function (el) {  el.addEvents({'mouseenter': trHover, 'mouseleave': trHover});  });  $$('.moodalbox').addEvent ('click', function (e) {	window.scrollTo(0, 0); // Janz nach oben links 	e.preventDefault(); 	if (!myRequest) { 		target = e.currentTarget;	 	myRequest = new Ajax(e.currentTarget.href, {	 		onComplete: lightCB	 	}).request();	} });});