$(document).ready(function(){

$("a.single_image").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayOpacity': 0.8,
		'overlayColor': '#000000',
		'titlePosition': 'inside',
		'scrolling': 'no'
	}); 	

function formatTitle(title, currentArray, currentIndex, currentOpts) {
	return 'Bild ' + (currentIndex + 1) + ' von ' + currentArray.length + (title && title.length ? '&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;<b>' + title + '</b>' : '' ) + '';
}

$("a.group").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayOpacity': 0.8,
		'overlayColor': '#000000',
		'titlePosition': 'outside',
		'margin': 100,
		'scrolling': 'no',
		'titleFormat'	: formatTitle
	});
			
		// Animation Footer
		
		$('.move_footer').hover(function(){
			//alert("Click");
			_this_footer = $(this);
			
			_this_footer.height(60);
			
			
		},function(){
			_this_footer.height(15);
		});
		
		
		
														 
		// Facts bei Bilder
		$('.fact_image').click(function(){
			_this = $(this);
			var position = _this.position();

			//alert(position.left);
			
			if(position.left >= 565) {
				_this.animate({
    			right: '0'
 				}, 500, function() {
					_this.find(' .fact_headline').css('background', 'url(' + bgsrc + '/images/template/bg_facts_plus_minus.gif) no-repeat right 0');
					_this.animate({
    				height: 300
  				}, 500, function() {
    				// Animation complete.
  				});
					position = _this.position();
					//alert(position.left);
  			});
			} else {
				_this.animate({
    					height: 25
  				}, 500, function() {
						_this.find(' .fact_headline').css('background', 'url(' + bgsrc + '/images/template/bg_facts_plus_minus.gif) no-repeat left 0');
    				_this.animate({
    						right: '-160'
 				 		}, 500, function() {
								position = _this.position();	
  				});	
				});
			};
		});
	
	
			Cufon.replace('h2'); //footer
			Cufon.replace('h3');
			Cufon.replace('#footer', {
				hover: true
			}); //mainnav
			Cufon.replace('ul.mainnav li a', {
				hover: true
			}); //submenu
			Cufon.replace('#submenu a', {
				hover: true
			});
			Cufon.now();


});


















