$(document).ready(function() {
	//hide all divs to start with except the start div!
	resetAll();
	
	//reset all divs to the default page load state
	function resetAll() {
		$('#buttonControls').hide();
		$('#MyHRM_Start').show();
		$('#MyHRM_ChooseActivity').hide();
		$('#running').hide();
		$('#cycling').hide();
		$('#triathlon').hide();
		$('#crosstraining').hide();
	}
	
	//start again
	$('#startAgain').click(function() {
		resetAll();
	});
	
	//get started
	$('#getStarted').click(function() {
		//hide start button
  		$('#MyHRM_Start').hide();
		
		//show options
		$('#MyHRM_ChooseActivity').show();
	});
	
	
	/*####################
	  ###### RUNNING #####
	  ####################*/
	
	//user chose running
	$('#chooseRunning').click(function() {
		//hide options
		$('#MyHRM_ChooseActivity').hide();
		
		//show running
		$('#running').show();
		$('#MyHRM_Running').show();
		$('#MyHRM_RunningWithSpeed').hide();
		$('#MyHRM_RunningNoSpeed').hide();
		$('#MyHRM_RunningWithSpeedUnder400').hide();
		$('#MyHRM_RunningWithSpeedOver400').hide();
		$('#MyHRM_RunningNoSpeedUnder300').hide();
		$('#MyHRM_RunningNoSpeedOver300').hide();
		
		//show nav buttons
		$('#buttonControls').show();
	});
	
	//chose running with speed
	$('#runningWithSpeed').click(function() {
		$('#MyHRM_Running').hide();
		$('#MyHRM_RunningWithSpeed').show();
	});
	
		//chose running with speed and budget < $400
		$('#runningWithSpeedUnder400').click(function() {
			$('#MyHRM_RunningWithSpeed').hide();
			$('#MyHRM_RunningWithSpeedUnder400').show();
		});
		
		//chose running with speed and budget > $400
		$('#runningWithSpeedOver400').click(function() {
			$('#MyHRM_RunningWithSpeed').hide();
			$('#MyHRM_RunningWithSpeedOver400').show();
		});
	
	//chose running no speed
	$('#runningNoSpeed').click(function() {
		$('#MyHRM_Running').hide();
		$('#MyHRM_RunningNoSpeed').show();
	});
	
		//chose running no speed and budget < $300
		$('#runningNoSpeedUnder300').click(function() {
			$('#MyHRM_RunningNoSpeed').hide();
			$('#MyHRM_RunningNoSpeedUnder300').show();
		});
		
		//chose running no speed and budget > $300
		$('#runningNoSpeedOver300').click(function() {
			$('#MyHRM_RunningNoSpeed').hide();
			$('#MyHRM_RunningNoSpeedOver300').show();
		});
	
	
	/*####################
	  ###### CYCLING #####
	  ####################*/
	  
	//user chose cycling
	$('#chooseCycling').click(function() {
		//hide options
		$('#MyHRM_ChooseActivity').hide();
		
		//show cycling
		$('#cycling').show();
		$('#MyHRM_Cycling').show();
		$('#MyHRM_CyclingUnder300').hide();
		$('#MyHRM_CyclingOver300').hide();
		
		//show nav buttons
		$('#buttonControls').show();
	});
	
	//chose cycling under $300
	$('#cyclingUnder300').click(function() {
		$('#MyHRM_Cycling').hide();
		$('#MyHRM_CyclingUnder300').show();
	});
	
	//chose cycling over $300
	$('#cyclingOver300').click(function() {
		$('#MyHRM_Cycling').hide();
		$('#MyHRM_CyclingOver300').show();
	});
	
	
	/*######################
	  ###### TRIATHLON #####
	  ######################*/
	
	//user chose triathlon
	$('#chooseTriathlon').click(function() {
		//hide options
		$('#MyHRM_ChooseActivity').hide();
		
		//show triathlon
		$('#triathlon').show();
		$('#MyHRM_Triathlon').show();
		$('#MyHRM_TriathlonWithSpeed').hide();
		$('#MyHRM_TriathlonNoSpeed').hide();
		$('#MyHRM_TriathlonWithSpeedUnder500').hide();
		$('#MyHRM_TriathlonWithSpeedOver500').hide();
		$('#MyHRM_TriathlonNoSpeedUnder300').hide();
		$('#MyHRM_TriathlonNoSpeedOver300').hide();
		
		//show nav buttons
		$('#buttonControls').show();
	});
	
	
	//chose triathlon with speed
	$('#triathlonWithSpeed').click(function() {
		$('#MyHRM_Triathlon').hide();
		$('#MyHRM_TriathlonWithSpeed').show();
	});
	
		//chose triathlon with speed and budget < $500
		$('#triathlonWithSpeedUnder500').click(function() {
			$('#MyHRM_TriathlonWithSpeed').hide();
			$('#MyHRM_TriathlonWithSpeedUnder500').show();
		});
		
		//chose triathlon with speed and budget > 500
		$('#triathlonWithSpeedOver500').click(function() {
			$('#MyHRM_TriathlonWithSpeed').hide();
			$('#MyHRM_TriathlonWithSpeedOver500').show();
		});
	
	//chose triathlon no speed
	$('#triathlonNoSpeed').click(function() {
		$('#MyHRM_Triathlon').hide();
		$('#MyHRM_TriathlonNoSpeed').show();
	});
	
		//chose triathlon no speed and budget < $300
		$('#triathlonNoSpeedUnder300').click(function() {
			$('#MyHRM_TriathlonNoSpeed').hide();
			$('#MyHRM_TriathlonNoSpeedUnder300').show();
		});
		
		//chose triathlon no speed and budget > $300
		$('#triathlonNoSpeedOver300').click(function() {
			$('#MyHRM_TriathlonNoSpeed').hide();
			$('#MyHRM_TriathlonNoSpeedOver300').show();
		});
	
	
	/*###########################
	  ###### CROSS TRAINING #####
	  ###########################*/
	
	//user chose cross training
	$('#chooseCrossTraining').click(function() {
		//hide options
		$('#MyHRM_ChooseActivity').hide();
		
		//show cross training
		$('#crosstraining').show();
		$('#MyHRM_CrossTraining').show();
		$('#MyHRM_CrossTrainingUnder200').hide();
		$('#MyHRM_CrossTrainingOver200').hide();
		
		//show nav buttons
		$('#buttonControls').show();
	});
	
	//chose cross training under $200
	$('#crosstrainingUnder200').click(function() {
		$('#MyHRM_CrossTraining').hide();
		$('#MyHRM_CrossTrainingUnder200').show();
	});
	
	//chose cross training over $200
	$('#crosstrainingOver200').click(function() {
		$('#MyHRM_CrossTraining').hide();
		$('#MyHRM_CrossTrainingOver200').show();
	});
});
