function foto_nderruesi() {
	$('.games_rotator li').css({opacity: 0.0});
	$('.games_rotator li:first').css({opacity: 1.0});
	var timeri = $('.games_rotator').attr('rel');
	setInterval('nderro()',timeri);
}

function nderro() {	
	var tash = ($('.games_rotator li.aktivi')?  $('.games_rotator li.aktivi') : $('.games_rotator li:first'));

    if ( tash.length == 0 ) tash = $('.games_rotator li:first');

	var tjetra = ((tash.next().length) ? ((tash.next().hasClass('aktivi')) ? $('.games_rotator li:first') :tash.next()) : $('.games_rotator li:first'));
	
	tjetra.css({opacity: 0.0}).addClass('aktivi').animate({opacity: 1.0}, 1000);

	tash.animate({opacity: 0.0}, 1000).removeClass('aktivi');
	
};

$(document).ready(function(){
	
	foto_nderruesi();
	$('.games_rotator').fadeIn(1000);
    $('.games_rotator li').fadeIn(1000);
	
	/*$('#brendet li').hover(function(){
		$(this).children('.brend_pershkrimi').css('display', 'block');
		$(this).children('.brend_pershkrimi').animate({ opacity: 0 }, 0);
		$(this).children('.brend_pershkrimi').stop().animate({ opacity: 1, bottom: "60px" }, 300);
	}, function(){
		$(this).children('.brend_pershkrimi').stop().animate({ opacity: 0, bottom: "90px" }, 300);
	});*/	
	
	$("#showcase").awShowcase(
	{
		content_width:			978,
		content_height:			424,
		hundred_percent:		false,
		auto:					true,
		interval:				5000,
		continuous:				true,
		loading:				true,
		tooltip_width:			200,
		tooltip_icon_width:		32,
		tooltip_icon_height:	32,
		tooltip_offsetx:		18,
		tooltip_offsety:		0,
		arrows:					false,
		buttons:				true,
		btn_numbers:			true,
		keybord_keys:			true,
		mousetrace:				false,
		pauseonover:			false,
		transition:				'fade', /* hslide/vslide/fade */
		transition_delay:		300,
		transition_speed:		500,
		show_caption:			'onhover', /* onload/onhover/show */
		thumbnails:				false,
		thumbnails_position:	'outside-last', /* outside-last/outside-first/inside-last/inside-first */
		thumbnails_direction:	'horizontal', /* vertical/horizontal */
		thumbnails_slidex:		0, /* 0 = auto / 1 = slide one thumbnail / 2 = slide two thumbnails / etc. */
		dynamic_height:			false,
		speed_change:			true,
		viewline:				false
	});
	
});
