// jquery Document

$(document).ready(function() {
	
	$('.show').css({'overflow' : 'hidden'});
	$('#show_panel_2').hide();
	$('#show_panel_3').hide();

	$('a#switcher_1').click(function() {
		$('#show_panel_1').fadeOut('fast');
		$('#show_panel_2').fadeIn('fast');
		$('#show_panel_3').fadeOut('fast');
		return false;
	});

	
	$('a#switcher_2').click(function() {
		$('#show_panel_1').fadeOut('fast');
		$('#show_panel_2').fadeOut('fast');
		$('#show_panel_3').fadeIn('fast');
		return false;
	});

	$('a#switcher_3').click(function() {
		$('#show_panel_1').fadeIn('fast');
		$('#show_panel_2').fadeOut('fast');
		$('#show_panel_3').fadeOut('fast');
		return false;
	});
	
	var s = $('#show_panel_1 img').size();
	var n = 0;
	var m = n+1;
	
	$('#stepper').text(''+m+' of '+s+'');
	
	$('a#next').click(function() {
		$('#show_panel_1 img').hide();
		n = n+1;
		if (n == s) { n = 0; }
		$('#show_panel_1 img:eq('+n+')').fadeIn('slow');
		m = n+1;
		$('#stepper').text(''+m+' of '+s+'');
		return false;
	});
	
	$('a#prev').click(function() {
		$('#show_panel_1 img').hide();
		n = n-1;
		if (n == -1) { n = s-1; }
		$('#show_panel_1 img:eq('+n+')').fadeIn('slow');
		m = n+1;
		$('#stepper').text(''+m+' of '+s+'');
		return false;
	});
	
	
	
	var t = $('div.row').size();
	var z = 0;
	var x = z+1;
		
	$('#t_stepper').text(''+x+' of '+t+'');
	
	$('a#t-next').click(function() {
		$('div.row').hide();
		z = z+1;
		if (z == t) { z = 0; }
		$('div.row:eq('+z+')').toggle('slow');
		x = z+1;
		$('#t_stepper').text(''+x+' of '+t+'');
		return false;
	});
	
	$('a#t-prev').click(function() {
		$('div.row').hide();
		z = z-1;
		if (z == -1) { z = t-1; }
		$('div.row:eq('+z+')').toggle('slow');
		x = z+1;
		$('#t_stepper').text(''+x+' of '+t+'');
		return false;
	});


});

