
$(document).ready(function() {

		infoBlocks = new Array();
		
		infoBlocksCounter = -1;
		

		elementCounter = -1;
		
		$('.rider .inside-text').children().each(function(i) {
			
			var domEl = $(this).get(0);
			
			if (domEl.tagName == 'H3'){
				
				if (infoBlocksCounter > -1){
					infoBlocks[infoBlocksCounter] = tempBlock;
				}
				
				infoBlocksCounter++;
				
				elementCounter = -1;
				tempBlock = new Array();
				
				

			}else{
				if (infoBlocksCounter > -1){
					
					elementCounter++;
					tempBlock[elementCounter] = $(this);
					
					$(this).hide(0);
					
				}
			}
	
		});
		
		
		if (infoBlocksCounter > -1){
			infoBlocks[infoBlocksCounter] = tempBlock;
		}
		
		showTab(0);
		
		$(document).find('h3').each(function(i) {
			
			$(this).click(function() {
				
				showTab(i-1);
				
			});
			
		});
	
	
});


function showTab(i){
	
	for (j = 0; j < infoBlocks.length; j++){
		
		tempBlock = infoBlocks[j];
		
		if (i == j){
			for (y = 0; y < tempBlock.length; y++){
				tempBlock[y].show(500);
			}
		}else{
			for (y = 0; y < tempBlock.length; y++){
				tempBlock[y].hide(500);
			}
		}
		
	}
	
}
