// JavaScript Document

$(function (){
	
	$('div.fancySection span').mouseover(function(){  
        $(this).find('em').stop().animate({top:'54px'},80);
    });
	
	$('div.fancySection span').mouseout(function(){  
        $(this).find('em').stop().animate({top:'77px'},80);
    });
	
	$('.slideInfo').click(function(){
		$('.slideInfoSide').show(10);
		$('.slideInfo').css('width','156px');
	});
	
	$('.slideInfoSide').mouseleave(function(){
		$(this).hide();
		$('.slideInfo').css('width','1px');
	});
	
	/*
	//for cycle pager
	$("div.fancyInside .fancySection").each(function(i){
		$("#cyclepager").append("<span>"+(i+1)+"</span>");
	})
	$("#cyclepager span:first").addClass("active");
	*/
	for (i=1;i<6;i++){
	$('#fancyInside'+i).cycle({
		cleartype:  true,
		fx: 'scrollHorz', 
		prev:   '#cyclePrev'+i, 
		next:   '#cycleNext'+i,
		timeout: 0,
		speed: 200,
		after: showPageInfo
	});
	}
	
});

function showPageInfo(curr,next,opts){
	//$("#cyclepager span").removeClass("active");
		//$("#cyclepager span:eq("+opts.currSlide+")").addClass("active");
		//alert('Page ' + (opts.currSlide + 1) + ' of ' + opts.slideCount)
		
		if (opts.currSlide + 1 ==  opts.slideCount){ $(opts.next).hide() } else { $(opts.next).show()};
		if (opts.currSlide + 1 > 1){ $(opts.prev).show() } else { $(opts.prev).hide()};
	}

