Event.observe(window, 'load', function() {
	
	// Popup Links finden und auf ein neues Fenster leiten
	var elemente = $$('.twitterButton');

	var screenwidth = screen.width;
	var screenheight = screen.height;
	var windowWidth = 550
	var windowHeight = 450;
	
	if(elemente.length > 0) {
		elemente.each(function(s, index) {
			var positionY;
			var positionX;
			var link;
			
			var positionX = (screenwidth / 2) - (windowWidth / 2);
			var positionY = (screenheight / 2) - (windowHeight / 2);
			
			link = s.href;
			s.href = 'JavaScript: void(0);';
			s.observe('click', function() {
				window.open(link, 'Twittern', "width=" + windowWidth + ",height=" + windowHeight + ",top=" + positionY + ",left=" + positionX);
				return false;
			});
		});
	}
});
