function initgallery() {
	var activeItem = null;	
	
	//thumbnails Links setzen
	$('a').each(function() {
		
		// Images 
		if (this.getAttribute('href') && (this.getAttribute('rel') == 'slide')){
			$(this).find('img').hover(function(){
				$(this).css('background','#f00;');
			}, function(){
				$(this).css('background','#fff;');
			});
			
			this.onclick = function () {
				$("#slide").toggle();
				$("#largeimg").html('<img src="'+this.href+'" width="435" />');
				setTimeout("$('#slide').fadeIn('slow')", 1000);				
				return false;
			}
		}
		
		// Videos
		if (this.getAttribute('href') && (this.getAttribute('rel') == 'video')){
			$(this).find('img').hover(function(){
				$(this).css('background','#f00;');
			}, function(){
				$(this).css('background','#fff;');
			});
			
			this.onclick = function () {
				$("#slide").toggle();
				$("#largeimg").html('<embed width="435" height="326" type="application/x-shockwave-flash" src="fileadmin/templates/swfs/flvplayer.swf" flashvars="file='+this.href+'&autostart=true&usefullscreen=false&frontcolor=0x8fd1df&lightcolor=0x666666" pluginspage="http://www.adobe.com/go/getflashplayer" />');
				setTimeout("$('#slide').fadeIn('slow')", 1000);				
				return false;
			}
		}
		
	});
}

