$(document).ready(function() {

	// breadcrumbs effect
	$(".flip").flipv();

	// toggle effect
	//
 	$(".jcarousel-skin-tango").slice(1).each(function(){
      $(this).parent().find("h3.view:eq(0)").addClass("minus");
  		$(this).parent().find("h3.view:eq(1)").addClass("plus");
      //$("h3.view",this).addClass("plus");
  		$(this).hide();
 	});
 	
	$("h3.view").click(function(){
  	//$(this).parent().next().slideToggle("slow");
  	//$(this).toggleClass("minus").parent().next().find("ul").slideToggle();
    $(this).removeClass("plus");	
    $(this).toggleClass("minus").next().slideToggle("slow");
    //$(this).next().slideToggle("slow");
  	return false;
 	});

	// funkcia pre vysunutie info o obrazku
	jQuery.fn.masque = function(classe) {	
		$(this).hover(function(){
		$(this).find(classe).stop().animate({height:"55px",opacity: "0.9"},400);
	},function () { 
		$(this).find(classe).stop().animate({height:"20px",opacity: "0"}, 400);
	});
	}
	// aplikacia funkcie
	$(".portfolio li").masque(".legend");
	$(".gallery li").masque(".legend");


  // jquery image loader - lazyload
  $(".gallery img").lazyload({ 
      threshold : 10,
      placeholder : "/img/loadingAnimation.gif",
      /*event : "click" ,*/
      effect : "fadeIn",
      failurelimit : 10 
  });
  $(".detail img").lazyload({ 
      threshold : 10,
      placeholder : "/img/loadingAnimation.gif",
      /*event : "click" ,*/
      effect : "fadeIn",
      failurelimit : 10 
  });

  // scrollTop
  $('#scrollTop').click(function() {
    $('html, body').animate({scrollTop: '0px'}, 1000,'easeOutQuart');
    return false;
  });

});
