$(document).ready(function() {

	/* color hover */
	$('.color-item').hover(
		function () { $(this).find('.hid').fadeIn('fast'); },
		function () { $(this).find('.hid').hide(); }
	);  


	/* where hover */
	$('.where').hover(
		function () { $(this).find('.hid2').fadeIn('fast'); },
		function () { $(this).find('.hid2').hide(); }
	);  


	/* produkty - stránkování náhledů */
	$("#gallery").pager("div.thumb");


	/* produkty - hover */
	$("#gallery a:not(.pager-active)").each(function () {
		$('img', this).css('opacity', 0.5)
		$(this).hover(function(){
			$('img', this).stop().animate({'opacity': 1});
		},function(){
			$('img', this).stop().animate({'opacity': 0.5});
		});
	});


	/* content slider */
	var slider = $('#slider1').bxSlider({
		controls: false
	});



	// assign a click event to the external thumbnails
	$('.thumbs a').live('click', function(){
		var thumbIndex = $('.thumbs a').index(this);
		// display "vzorníky title"
		$('.combinationsTitle').show('slow');
		
		// call the "goToSlide" public function
		slider.goToSlide(thumbIndex);
	  
		// remove all active classes
		$('.thumbs a').removeClass('pager-active');
		// assisgn "pager-active" to clicked thumb
		$(this).addClass('pager-active');
		// very important! you must kill the links default behavior
		return false;
	});



	// otevře 1. produkt po kliku na úvodní obrázek
	$('.imageFirst').live('click', function(){

		// display "vzorníky title"
		$('.combinationsTitle').show('slow');

		// podtržení 1. obrázku
		$('.thumbs a:first-child').addClass('pager-active');
		
		// call the "goToSlide" public function
		slider.goToSlide(1);
	});


	// akce 
	$(".actionAdd").fancybox({
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'overlayShow' : true,
		'overlayOpacity' : 0.6,
		'overlayColor' : '#222',
		'titlePosition': 'outside',
		'padding'		: 0,
		'margin' : 0,

	});
	$(".actionAdd").trigger('click');


});
