function onAfter(curr, next, opts) {
    var index = $(this).parent().children().index(this);
    $('.relationsPrev')[index == 0 ? 'hide' : 'show']();
    $('.relationsNext')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}
$(document).ready(function(){
	$(".ramka").css("border","none");
	$(".ramka-tresc").css("border","none");
	$(".ramka-tresc").css("display","none");

	$(".ramka h2").click(function(){
		$(".ramka-tresc").toggle("slow");


	});


	$('.boxRelations').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.relationsPrev',
			           next: '.relationsNext'});
	$('.boxExhibitors').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.relationsPrev',
			           next: '.relationsNext'});
	$('.boxTargs').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.relationsPrev',
			           next: '.relationsNext'});
	$('.boxPages').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.relationsPrev',
			           next: '.relationsNext'});
	$('.boxNewRelations').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.newRelationsPrev',
			           next: '.newRelationsNext'});
	$('.boxNewTargs').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.newTargsPrev',
			           next: '.newTargsNext'});
	$('.boxRelationsCat').cycle({fx: 'scrollHorz',
		                   speed: 300,
		                   timeout: 0,
			           prev: '.relationsPrev',
			           next: '.relationsNext'});




	/****************hover dla boxow****************/

	$(".relationsItem").hover(
		function()
		{
		$(this).removeClass("relationsItem");
		$(this).addClass("relationsItem-hover");
		$(this).children(".tag").removeClass("panelTag");
		$(this).children(".tag").addClass("panelTag-hover");
		},
		function()
		{
		$(this).removeClass("relationsItem-hover");
		$(this).addClass("relationsItem");
		$(this).children(".tag").removeClass("panelTag-hover");
		$(this).children(".tag").addClass("panelTag");
		}

	);
	$(".newItem").hover(
		function()
		{
		$(this).removeClass("newItem");
		$(this).addClass("newItem-hover");
		$(this).children(".tag").removeClass("panelTag");
		$(this).children(".tag").addClass("panelTag-hover");
		},
		function()
		{
		$(this).removeClass("newItem-hover");
		$(this).addClass("newItem");
		$(this).children(".tag").removeClass("panelTag-hover");
		$(this).children(".tag").addClass("panelTag");
		}

	);
	$(".exhibitorsItem").hover(
		function()
		{
		$(this).removeClass("exhibitorsItem");
		$(this).addClass("exhibitorsItem-hover");
		},
		function()
		{
		$(this).removeClass("exhibitorsItem-hover");
		$(this).addClass("exhibitorsItem");
		
		}

	);
	$(".targsItem").hover(
		function()
		{
		$(this).removeClass("targsItem");
		$(this).addClass("targsItem-hover");
		},
		function()
		{
		$(this).removeClass("targsItem-hover");
		$(this).addClass("targsItem");
		
		}

	);
	$(".pagesItem").hover(
		function()
		{
		$(this).removeClass("pagesItem");
		$(this).addClass("pagesItem-hover");
		},
		function()
		{
		$(this).removeClass("pagesItem-hover");
		$(this).addClass("pagesItem");
		
		}

	);
	$(".relationsItemCat").hover(
		function()
		{
		$(this).removeClass("relationsItemCat");
		$(this).addClass("relationsItemCat-hover");
		$(this).children(".tag").removeClass("panelTag");
		$(this).children(".tag").addClass("panelTag-hover");
		},
		function()
		{
		$(this).removeClass("relationsItemCat-hover");
		$(this).addClass("relationsItemCat");
		$(this).children(".tag").removeClass("panelTag-hover");
		$(this).children(".tag").addClass("panelTag");
		
		}

	);
	


});
