$(function (){
	
	$('.curWorks li:first').fadeIn(500).addClass('current-pic1');
	var piccounter = $('.curWorks li').size();

	$(function pics() {		
		var curnum = $('.current-pic1').index() - 1;
		var nextpic = curnum;		

		$('.current-pic1').delay(3000).fadeOut(1000).removeClass('current-pic1');
		$('.curWorks li').eq(nextpic).addClass('current-pic1').delay(3000).fadeIn(1000, function () {
			pics();
		});		
	});

	//contacts gallery
	$('div.bc-photo-prv a').click(function () {
		//var bigpic = $(this).attr('href');
		//var bigpicb = $(this).find('img').attr('alt');

		$('div.bc-photo-prv').removeClass('active-bc-pic');
		$(this).parent('div.bc-photo-prv').addClass('active-bc-pic');

		var numb = $(this).parent('div.bc-photo-prv').index() - 1;
		$('#bc-photo-full a').hide();
		$('#bc-photo-full a').eq(numb).show();
		
		//$('#bc-photo-full img').remove();
		//$('#bc-photo-full').html('<a href="' + bigpicb + '"><img src="' + bigpic + '" alt="" /></a>');
		
		return false;
	});

});
