window.addEvent('domready', function() {
	//vorbereitung

	$('gallery').getElements('.popup').each(function(el) {
		if(el.getElement('img'))
		{
			el.set(
				'href', 
				el.getElement('img').get('src').replace(/height=100/g, 'width=520')
			);
		}
	});
	
	$('openGallery').addEvent('click', function(cEv) {
		new Event(cEv).stop();
		var galeryElementLink = $('gallery').getElements('a.popup')[0];
		cEv.target = galeryElementLink;
		galeryElementLink.fireEvent('click', cEv);
	});
	
	//multibox initialisieren
	var initMultiBox = new multiBox({
		initialSize: {w:550, h:250},
		mbClass: '.popup',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
		container: $(document.body),//where to inject multiBox
		descClassName: 'multiBoxDesc',//the class name of the description divs
		path: './Files/',//path to mp3 and flv players
		useOverlay: true,//use a semi-transparent background. default: false;
		maxSize: {w:520, h:1024},//max dimensions (width,height) - set to null to disable resizing
		addDownload: false,//do you want the files to be downloadable?
		pathToDownloadScript: './Scripts/ForceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
		addRollover: false,//add rollover fade to each multibox link
		addOverlayIcon: false,//adds overlay icons to images within multibox links
		addChain: false,//cycle through all images fading them out then in
		recalcTop: true,//subtract the height of controls panel from top position
		addTips: true,//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips),
		fixedTop: 50
	});
});