jQuery(function(){

	jQuery("a.lightbox").fancybox({
		'speedIn'		:	600,
		'speedOut'		:	200,
		'padding'		:	20,
		'overlayOpacity':	0.7,
		'overlayColor'	:	'#000',
		'onComplete'	:	jQuery.fancybox.resize,
		'titlePosition'	:	'inside',
		'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) {
			//console.log(jQuery('.fancybox-title-inside').outerWidth(true));
	    	//console.log(currentOpts);
			var stringReturn = '<span id="fancybox-imageno">Bild ' +  (currentIndex + 1) + ' von ' + currentArray.length + '</span>';
	    	jQuery('#fancy-bg-n').empty();
	    	jQuery('#fancy-bg-n').append(stringReturn);
	    	return title;
		},
		'onComplete'	: function(currentArray, currentIndex, currentOpts){
			jQuery('#fancybox-title').width(jQuery('#fancybox-title').width() - 70);
		}
	});

	jQuery("a.clickToEnlarge-lightbox").fancybox({
		'speedIn'		:	600,
		'speedOut'		:	200,
		'padding'		:	20,
		'overlayOpacity':	0.7,
		'overlayColor'	:	'#000',
		'titlePosition'	:	'inside'
	});

	jQuery("a.swf-lightbox").fancybox({
		'speedIn'		:	600,
		'speedOut'		:	200,
		'width'			:	580,
		'padding'		:	20,
		'overlayOpacity':	0.7,
		'overlayColor'	:	'#000'
	});
	jQuery("a.form-lightbox").fancybox({
		'speedIn'		:	600,
		'speedOut'		:	200,
		'width'			:	580,
		'height'		:	540,
		'padding'		:	20,
		'overlayOpacity':	0.7,
		'overlayColor'	:	'#000',
		'type'			: 'iframe'
	});



	/*jQuery('a.swf-lightbox').click(function(){

		flvName = String(jQuery(this).attr('href'));
		jQuery(this).attr('href','');


		var newFlashElement = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0" id="jquery_fancybox_flvmovie" width="580" height="435" align="center">';
		newFlashElement += '<param name="loop" value="true">';
		newFlashElement += '<param name="menu" value="false">';
		newFlashElement += '<param name="quality" value="best">';
		newFlashElement += '<param name="scale" value="noscale">';
		newFlashElement += '<param name="bgcolor" value="#FFFFFF">';
		newFlashElement += '<param name="wmode" value="transparent">';
		newFlashElement += '<param name="swliveconnect" value="false">';
		newFlashElement += '<param name="FlashVars" value="">';
		newFlashElement += '<param name="movie" value="';
		newFlashElement += flvName;
		newFlashElement += '">';
		newFlashElement += '<embed wmode="transparent" src="';
		newFlashElement += flvName;
		newFlashElement += '" FlashVars="" swliveconnect="false" loop="true" menu="false" quality="best" scale="noscale" bgcolor="#FFFFFF" width="580" height="435" name="jquery_fancybox_flvmovie" align="top" type="application\/x-shockwave-flash" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer">';
		newFlashElement += '<\/embed>';
		newFlashElement += '<\/object>';

		jQuery(this).parent('.hide_gallery').prepend(newFlashElement);

		jQuery(this).fancybox({
			'speedIn'		:	600,
			'speedOut'		:	200,
			'width'			:	580,
			'padding'		:	20,
			'overlayOpacity':	0.7,
			'overlayColor'	:	'#000',
			'onComplete'	:	function(){
									jQuery('#fancybox-inner').html(newFlashElement);
								}
		});
	});*/

});
