/*
$(document).ready(function() {

   var i = 0;
   var count = $('.elementX').length;
   $('.elementX').click(function() {
       i++;
       $(this).hide();
       if (i < count) {
           $(this).next().next().fadeIn(1900);
       } else {
           $('ul#element-panel li.first').fadeIn(1900);
           i = 0;
       }
   });


});
*/

$(document).ready(function() {

	var i = 0;
	var count = $('.elementX').length;
	var timebreake = 5600;

	function slides(el) {
		i++;
		
		setTimeout(function() {
			el.hide();

			if (i > 1) timebreake = 5600;
			if (i < count) {

				el.next().next().fadeIn(1200);
				slides(el.next().next());
			} else {

				i = 0;
				$('ul li.first').fadeIn(1200);
				slides($('ul li.first'));
			}

		}, timebreake);
		

	}
	
	slides($('ul li.first'));

});
