$(document).ready(function() {

$(function() {
	
	$('a.lightbox').lightBox(); 
		$('ul#navleft li a, ul#categorymenu li.level1 a').hover(function() {
						   
						 $(this).animate({ paddingLeft: "35px"}, 250);
						  }, function() {
						 $(this).animate({ paddingLeft: "30px"}, 250);
						   }
						 );
		
		$('ul li.level2 a').hover(function() {
						   
						 $(this).animate({ paddingLeft: "5px"}, 250);
						  }, function() {
						 $(this).animate({ paddingLeft: "0px"}, 250);
						   }
						 );
	
		$('a img, input,  a.partners, a.models, a.karriere').hover(function() {
						   
						 $(this).fadeTo(250, 0.7);
						  }, function() {
						 $(this).fadeTo(250, 1.0);
						   }
						 );
	
	$('.readmore').click(function() {
						   
						 $('div.news').animate({height: "300px" }, 500);
						 $('div.close').show();
						 $('div.readmore').hide();
						 
						  });
						  
	$('div.close').click(function() {
						   
						 $('div.news').animate({height: "65px"}, 500);
						 $('.readmore').show();
						 $('div.close').hide();
						  });
	
	
	/* Bestellformular */
	
	$('#liefer, #nichtliefer').click(function() {
						 $('td#toggle').toggle();
						 $('#liefer').toggle();
						  });
	
	$('.sonderanzahl, .eindruck').hide();
	$('option#hks').click( function() { $('.sonderanzahl').show(); } );
	$('option.nohks').click( function() { $('.sonderanzahl').hide(); } );
	$('option.miteindruck').click( function() { $('.eindruck').show(); } );
	$('option.ohneeindruck').click( function() { $('.eindruck').hide(); } );
						 


		jQuery('#about').accordion({
		    header: 'h2.title', 
    		alwaysOpen: false, 
   		 	
    		autoheight: false 
		
		}); 
		
		jQuery('#news').accordion({
		    header: 'h2.title', 
    		alwaysOpen: false,
			active: false,  
   		 	
    		autoheight: false 
		
		}); 
		

		
		
jQuery(function($) {
		
		$('.showcase_unstyled').addClass('showcase'); // adds new class name to maintain degradability
		$('.showcase li:eq(0)').addClass('active');
		$('ul.showcase').galleria({
			history   : true, // activates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable
			insert    : '#main_image', // the containing selector for our main image
			onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				image.css('display','none').fadeIn(500);
			
				caption.css('display','none').fadeIn(1000);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				_li.siblings().children('img.selected').fadeTo('fast',0.5);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',1).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next >');
			},
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '1' : '0.5';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).show();
				
				// hover effects
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',0.5); } // don't fade out if the parent is active
				)
			}
		});
	});





		


	
	
});



});

