jQuery.noConflict();
		
(function($) {
	$(function(){
		var rotate360wrapper = '<a href="#" class="open-rotate360" />';
		var rotate360icon = '<span class="rotate360-icon" />';
		var $rotateImage = $('.csc-textpic-imagewrap img:first');
		
	// Link-Wrapper
		if( $rotateImage.parent()[0].tagName.toLowerCase() != 'a')
			$rotateImage.wrap( rotate360wrapper );
		else if( !$rotateImage.parent().hasClass('open-rotate360') )
			$rotateImage.parent().addClass('open-rotate360');
	
	// Rotate-Icon
		if( !$rotateImage.siblings('.rotate360-icon').length )
			$rotateImage.before( rotate360icon );

		$('.open-rotate360').click(function(e) {
			$(this).blur();
			$.fancybox({ // fancybox options
				 'padding'			: 0
				,'href'				: '/fileadmin/fm-dam/products/360/SB_3000HF/fallback02.jpg'
				,'transitionIn'		: 'none'
				,'transitionOut'	: 'none'
				,'autoDimensions'	: false
				,'autoScale'		: false
				,'width'			: 700
				,'height'			: 700				
				,onComplete			: function() {
					setTimeout(function() {
						$('#fancybox-inner').find('img:first')
							.addClass('rotate360')
							.rotate360({ // rotate360 options
								 lightbox	: '#fancybox-inner'
								,images: {
									 mode 			: 'single' // row/col/one/cross/single
									,row			: {
										 images		: 36
										,endless	: true
									 }
									,col			: {
										 images		: 9
										,endless	: false
									 }
									,folder			: '/fileadmin/fm-dam/products/360/SB_3000HF/'
									,imagePattern	: {
										single	: 'SB_3000HF-MOW_Count.jpg'
									 }
								 }
								 ,defaultCol: 26
							});
					}, 100);
				 }
			});
			return false;
		});
	});
}(jQuery));	