function swapImage(){

	var $active = $('.current2');
	var $activepage = $('.page-current');
	var $next = ($('.current2').next().length > 0) ? $('.current2').next() : $('.gallery-item:first');
	if ($('.page-current').next('li').length > 0){var $next2 = $('.page-current').next();}
	else {
		if ( ($('.page-current').parent().next('ul').length) > 0){  $next2 = $('.page-current').parent().next('ul').children('.img-page:first');  }
		else {$next2 = $('.img-page:first'); }
	}
	$active.fadeOut("slow", function(){
		$active.removeClass('current2');
		$activepage.removeClass('page-current');
		jQuery('.gallery-item').each(function(){ $(this).hide(); });
		jQuery('.img-page').each(function(){
			$(this).children().css({color:'#B1B2BA'});});
		$next2.addClass('page-current').children().css({color:'#EB6909'});
		$next.fadeIn("slow").addClass('current2');
		$('.info-img-title').html($('.current2').children('.gallery-icon').children('a').attr('title'));
		$('.info-img-desc').html($('.current2').children('.gallery-caption').html());

		
	});

  }
jQuery(function() {
	// Use this example, or...
	jQuery('a.lightbox').lightBox();
});
jQuery(document).ready(function(){

	jQuery('.gallery-item').each(function(){
		jQuery(this).hide();
	});	
	jQuery('.gallery-caption').each(function(){
		jQuery(this).hide();
	});

	jQuery('.gallery-item:first').addClass('current2').show();
	jQuery('.img-page:first').addClass('page-current').children().css({color:'#EB6909'});
	
	$('.info-img-title').html($('.current2').children('.gallery-icon').children('a').attr('title'));
		$('.info-img-desc').html($('.current2').children('.gallery-caption').html());
		
	jQuery('.img-page').children('a').click(function(){
		jQuery('.img-page').children('a').each(function(){
			$(this).css({color:'#B1B2BA'});}).parent('li').removeClass('page-current'); 
		
		
		$(this).css({color:'#EB6909'}).parent('li').addClass('page-current');
		
		var $next = $('.img-'+$(this).html());
		$('.current2').fadeOut("slow", function(){

			$(this).removeClass('current2');
			$next.fadeIn("slow").addClass('current2');

		});
	});

	jQuery('.menu_gen').each(function(){
		jQuery(this).children('ul').hide();
		jQuery(this).children('.vcard').hide();
	});
	jQuery('.div_selected').children('ul').show();
	jQuery('.div_selected').children('.vcard').show();
	jQuery('.menu_img').click(function(){

		jQuery('.div_selected').children('ul').hide('slow');
		jQuery('.div_selected').children('.vcard').hide('slow');
		jQuery('.div_selected').removeClass('img_selected');
		jQuery(this).parent('.menu_gen').addClass('div_selected');
		jQuery(this).parent('.menu_gen').children('ul').toggle('slow');
		jQuery(this).parent('.menu_gen').children('.vcard').toggle('slow');

	}),

	setInterval('swapImage()', 4000);

});
